第一范文网 - 专业文章范例文档资料分享平台

C语言基础

来源:用户分享 时间:2025/8/25 10:29:53 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

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语言基础 的文档
C语言基础.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c9luq34roz941z4g1ryxy_12.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top