《c程序设计语言》读书笔记--闰年和字符输入不用 && ||
2014-10-30 09:28
211 查看
#include <stdio.h> #include <string.h> #define sta 1500 #define Num 1600 int main() { int year; for(year = sta;year < Num + 1;year++) if(year % 4 == 0) { if(year % 400 == 0) { printf("%d \n",year); } else if (year % 100 != 0) { printf("%d \n",year); } } return 0; }
闰年判断。
#include <stdio.h> #include <string.h> #define Num 1600 int main() { int c,i = 0; char s[Num]; while(i < (Num - 1)) { c = getchar(); if(c == EOF) break; else if(c == '\n') break; s[i] = c; i++; } s[i] = '\0'; return 0; }
字符输入不用&& ||。
相关文章推荐
- 《c程序设计语言》读书笔记--闰年和字符输入不用 && ||
- 《c程序设计语言》读书笔记--每行一个单词打印输入的字符,除去空符
- 《c程序设计语言》读书笔记--首次输入不能是空符;最多10个字符
- 输入子系统读书笔记&nbsp;&nbsp;input
- SQL点滴6—“微软不认识闰年2月29日”&字符"N"的作用
- Android字符串特殊字符'&'的输入的处理
- Jquery选择器,选择ID以"某某"字符开头的一组文本框只能输入数字
- 搜狗拼音的自定义短语,可以输入一些特殊字符(比如'oaorfa'输入‘α’)
- EditText的光标选择(android.text.Selection)&输入指定字符
- c语言scanf()停止接受输入及scanf("%c",&c)吃掉回车或者空格字符的问题
- 有没有不用string类就可以实现动态的输入字符串,编写时不限定字符个数!!急急!!!
- SQL*PLUS环境输入'&字符'的方法
- 《c程序设计语言》读书笔记-删除字符串中匹配的字符
- 《Windows程序设计》读书笔记------------->>字符消息<<
- 《c程序设计语言》读书笔记--统计字符数
- Flex&nbsp;TextInput&nbsp;禁止输入特殊字符[…
- 设置终端属性,不用回车获取终端输入字符
- 从键盘输入一些字符,逐个把它们送到键盘上去,直到输入一个"#"为止
- vim小技巧:不用切换到输入模式交换前后字符
- TextBox属性TextMode="MultiLine"后字符输入长度控制的方法。