小练习——输出9*9乘法表,判断闰年
2016-07-27 17:20
260 查看
输出9*9乘法表
判断闰年:
#include <stdio.h> #include <stdlib.h> int main() { printf("输出9*9乘法表:\n"); int i = 1; int j = 1; for (i = 1; i <= 9; i++) { for (j = 1; j <= i; j++) { printf("%2d*%d=%2d ", i, j, i*j); } printf("\n"); } system("pause"); return 0; }
判断闰年:
#include<stdio.h> #include<stdlib.h> int main() { printf("请输入任一年份:\n"); int year=0; scanf("%d",&year); if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) printf("yes!\n");//是闰年 else a0e6 printf("no!\n");//不是闰年 system("pause"); return 0; }
相关文章推荐
- CSU 1765 简单shell 模拟
- HDU 4864 Task (贪心)
- Cygwin 篇
- tomcat下manager配置
- Android基础:三种inflate的区别
- 用UIWebView打开文档(doc、xls、pdf等)
- iOS之 多线程中的NSOperation
- vi
- 字符串拷贝函数strcpy()
- 《Windows核心编程》之”Unicode vs ANSI“
- cmd下输入python,报不是内部或外部命令错误的解决方法
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题
- CSU 1775 悲催的移寝 贪心
- linux目录详解
- LA-3942(trie树+dp)
- 对象实例化过程
- mysql主从复制
- 【嵌入式学习日记】2016年7月26日
- 时间格式转换
- 子查询