C语言基础

2026/4/26 0:15:28

Recently Brother.R has designed a BBS. Everyday there are many people register or login or logout.You are asked to help deal with these requests.There are three different requests, \

\\

%user or password!\login many times.

%user is on-line.

Every string will only contain lower-case letter or digit, and the range of its length is [1, 10].

Initially there is no user.

Input

The first line is integer N(N <= 20), the number of test requests. Then N lines, each line is one of three formats below:

register str1 str2 (str1 is the username and str2 is the password). login str1 str2 (str1 is the username and str2 is the password). logout str1 (str1 is the username).

Output

For each request, print the corresponding reply.

Sample Input

3

registerqige 123456 loginqige 123456 logoutqige

Sample Output

Congratulations, qige! Welcome qige! Goodbye qige!

Source

wangyao

4049

Description

素月是什么,吃素的月?Oh,No!素月是素数月。下面我们定义素月。yyyy年MM月是素月当且仅当yyyyMM是素数的情况。

比如2000年03月组成的数字是200003,它是素数,所以2000年03月是素月。

2000年12月组成的数字是200012,它不是素数,所以2000年12月不是素月。

现在给你一个起始年月和终止年月,要你判断在起始年月与终止年月之间(包括起始年月和终止年月)有多少素月。

Input

多组测试数据,每一组数据一行,四个整数(ys,ms,ye,me),以空格分开,分别代表起始年,起始月,终止年,终止月。

数据保正起始年月在时间上是在终止年月之前或者相等的。 2000<=ys<=ye<2100, 1<=ms,me<=12,

数据处理到文件末尾。

Output

输出一个整数,占一行,代表起始年月与终止年月之间(包括起始年月和终止年月)素月的个数。

Sample Input

2000 1 2000 3 2000 12 2000 12 2000 1 2099 12

Sample Output

1

0 101

Source

CWW

感想 我以为我可以很快地搞定,没想到居然花了这么多时间。在过程中,我自己看到了自己当初很多的不足。即使是现在的我也不能保证做得很好。希望能对你有所帮助。有什么地方不懂就问我吧~~


C语言基础.doc 将本文的Word文档下载到电脑
搜索更多关于: C语言基础 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219