C语言:基本控制结构(12)
if((s[i]>'a'&&s[i]<'z')||(s[i]>'A'&&s[i]<'Z')||(s[i]>'0'&&s[i]<'9')||s[i]=='_') flag=1; else { flag=0; break;//出现错误,跳出循环 } } } else flag=0; if(flag==0) printf(\ if(flag==1) printf(\ } }
简单密码破解
Time Limit: 1000MS Memory limit: 65536K
题目描述
密码是我们生活中非常重要的东东,我们的那么一点不能说的秘密就全靠它了。哇哈哈. 接下来渊子要在密码之上再加一套密码,虽然简单但也安全。
假设渊子原来一个BBS上的密码为zvbo941987,为了方便记忆,他通过一种算法把这个密码变换成YUANzi1987,这个密码是他的名字和出生年份,怎么忘都忘不了,而且可以明目张胆地放在显眼的地方而不被别人知道真正的密码。
他是这么变换的,大家都知道手机上的字母: 1--1, abc--2, def--3, ghi--4, jkl--5, mno--6, pqrs--7, tuv--8 wxyz--9, 0--0,就这么简单,渊子把密码中出现的小写字母都变成对应的数字,数字和其他的符号都不做变换,声明:密码中没有空格,而密码中出现的大写字母则变成小写之后往后移一位,如:X,先边成小写,再往后移一位,不就是y了嘛,简单吧。记住,z往后移是a哦。 输入
输入包括多个测试数据。输入是一个明文,密码长度不超过100个字符,输入直到文件结尾。 输出
输出渊子真正的密文。 示例输入 YUANzi1987 示例输出 zvbo941987
#include
闰年
Time Limit: 1000MS Memory limit: 32768K
题目描述
时间过得真快啊,又要过年了,同时,我们的人生也增长了一年的阅历,又成熟了一些。可是,你注意过今年是不是闰年呢,明年呢?
以上是闰年的计算方法的流程图,聪明的你能否通过编程计算任意给出的一个年份是否是闰年呢?相信这个问题你能很快解决掉。 输入
只有一个整数year,代表年份范围在1900~2060之间。 输出
如果是闰年输出Yes,否则输出No。 示例输入 2000 示例输出 Yes
#include
Friday the Thirteenth
Time Limit: 1000MS Memory limit: 65536K
题目描述
Is Friday the 13th really an unusual event?
That is, does the 13th of the month land on a Friday less often than on any other day of the week? To answer this question, write a program that will compute the frequency that the 13th of each month lands on Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday over a given period of N years. The time period to test will be from January 1, 1900 to December 31, 1900+N-1 for a given number of years, N. N is non-negative and will not exceed 400.
There are few facts you need to know before you can solve this problem:
? January 1, 1900 was on a Monday.
? Thirty days has September, April, June, and November, all the rest have 31 except for
February which has 28 except in leap years when it has 29.
? Every year evenly divisible by 4 is a leap year (1992 = 4*498 so 1992 will be a leap year,
but the year 1990 is not a leap year)
? The rule above does not hold for century years. Century years divisible by 400 are leap
years, all other are not. Thus, the century years 1700, 1800, 1900 and 2100 are not leap years, but 2000 is a leap year. Do not use any built-in date functions in your computer language. Don't just precompute the answers, either, please. PROGRAM NAME: friday
输入
there are several test cases, each have the following format: One line with the integer N.
输出 For each input, there is an output correspond to it, each have the following format: Seven space separated integers on one line. These integers represent the number of times the 13th falls on Saturday, Sunday, Monday, Tuesday, ..., Friday. 示例输入 20
示例输出
36 33 34 33 35 35 34
Geometry Made Simple
Time Limit: 1000MS Memory limit: 65536K
题目描述
Mathematics can be so easy when you have a computer. Consider the following example. You probably know that in a right-angled triangle, the length of the three sides a, b, c (where c is the longest side, called the hypotenuse) satisfy the relation a*a+b*b=c*c. This is called Pythagora's Law.
Here we consider the problem of computing the length of the third side, if two are given.
输入
The input contains the descriptions of several triangles. Each description consists of a line containing three integers a, b and c, giving the lengths of the respective sides of a right-angled triangle. Exactly one of the three numbers is equal to -1 (the 'unknown' side), the others are positive (the 'given' sides).
A description having a=b=c=0 terminates the input. 输出
For each triangle description in the input, first output the number of the triangle, as shown in the sample output. Then print \side lengths. Otherwise output the length of the 'unknown' side in the format \the name of the unknown side (a, b or c), and l is its length. l must be printed exact to three digits to the right of the decimal point.
Print a blank line after each test case. 示例输入 3 4 -1 -1 2 7 5 -1 3 0 0 0 示例输出
…… 此处隐藏:2124字,全部文档内容请下载后查看。喜欢就下载吧 ……相关推荐:
- [基础教育]2016-2022年中国钢芯铝绞线市场现状调
- [基础教育]语文部编版初一语文下册练习题 句式变
- [基础教育]南京继续教育参考答案--深入学习贯彻习
- [基础教育]国旗下讲话稿——珍惜时间好读书
- [基础教育]北师大版六年级数学下册圆锥的体积教学
- [基础教育]人教版-音乐-四年级下册-四年级下册音
- [基础教育]乔布斯2019年斯坦福大学毕业典礼致辞.d
- [基础教育]2015年加油站安全知识竞赛试题及答案
- [基础教育]2020年教师年度考核个人工作总结
- [基础教育]2019年中考历史试题-2019年大庆市初中
- [基础教育]初三仁爱英语第一轮总复习教案
- [基础教育]SG-A094电气配管安装工程隐蔽验收记录
- [基础教育]冀教版小学数学三年级下册第六单元教材
- [基础教育]青岛版(五制)小学科学二年级下册16《制
- [基础教育]2018-2019年初中科学初一中考真卷测试
- [基础教育]幼儿园大班期末简短评语精选
- [基础教育]2018云南临沧公务员考试申论技巧:这样
- [基础教育]学校食堂经营管理方案
- [基础教育]新中国砥砺奋进的七十年原文
- [基础教育]真空泵的选型及常用计算公式
- 高职田径课程教学现状与对策
- 全髋关节置换术在老年股骨颈骨折患者中
- 青人社厅函〔2016〕576号(附件)工资
- cp101-07砂子检验作业指导书 - secret
- 微观经济学 第八章 博弈论 习题
- 2014高考真题(词语运用)汇编及答案
- 2018年人教版七年级语文下册《第三单元
- 苏教版数学四年级上册第一单元试题 - M
- 四川大学新闻与传播考研2000-2010年真
- 浙江万里学院英语专业四年制本科教学计
- 最新2018马年事业祝福语-范文word版(2
- 最全模具行业术语英文翻译
- 皮亚杰的发展心理学理论
- 64篇高考情景式默写 练习题及答案
- 仿写(学生稿)
- 《SQL Server数据库技术》试卷A
- 第七章作业答案
- 江苏省赣榆县海头高级中学高中语文必修
- 浙江省2001年10月自考正常人体解剖学答
- 2012英语重点短语




