Pace 1 (PrimeNumber & MultTable & LeapYear)
来源:互联网 发布:加工中心编程实例讲解 编辑:程序博客网 时间:2024/06/04 20:01
查找并输出100-200之间的素数
#include <stdio.h>#include <math.h>int main(){int i, j, k;for (i = 101; i <= 200; i=i+2){k = sqrt(i);for (j = 2; j <= k; j++)if (i%j == 0)break;if (j>=k+1){printf("%8d", i);}}system("pause");return 0;}
打印九九乘法表
#include <stdio.h>int main(){int i, j, k = 0;for (i = 1; i <= 9; i++){for (j = 1; j <= i; j++){k = i*j;printf("%d*%d=%2d ", i, j, k);}printf("\n");}system("pause");return 0;}
查找并输出1000-2000之间的闰年
#include <stdio.h>int main(){int y,l=0;for (y = 1000; y <= 2000; y++){if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)){printf("%d ", y);l++;}if (l % 20 == 0)printf("\n");}system("pause");return 0;}
由于使用VS2013,程序运行后显示屏总是一闪而过,所以代码后加了system("pause");
阅读全文
0 0
- Pace 1 (PrimeNumber & MultTable & LeapYear)
- LeapYear
- Leapyear
- ECG - Pace Detection 起搏信号检测(1)
- juage leapyear
- public class PrimeNumber
- public class PrimeNumber
- pace简介
- LeapYear先行版
- LeapYear终极版
- 如何判断LeapYear
- PACE DESIGH名词解释
- 管理模型之PACE
- pace 10 (注释转换)
- 产品生命周期优化法PACE
- 页面加载进度条pace.js
- ECG - Pace Detection 起搏信号检测(2)
- no more pace up and down
- 贪心算法的总结与反思
- 【推荐】时光相册,我用过最好的相册管理软件
- 解决WordPress在新建页面无法选择主题页面模板 WordPress无法识别安装的主题
- 课设
- Visual Studio debug模式和release模式 CUDA 结果不同的解决
- Pace 1 (PrimeNumber & MultTable & LeapYear)
- yum报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:
- 挑战程序竞赛系列(86):3.6极限情况(3)
- 帐号,密码,手机,邮箱,姓名较验工具类
- [BZOJ]1880: [Sdoi2009]Elaxia的路线 spfa+拓扑图DP
- Android日志类----CscSDK
- hive 自动加载数据多分区目录
- 在react-native中使用redux
- Linux uptime实现详解