上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 29 下一页
摘要: //数组//接受键盘输入的100个整数,然后将它们按照和原顺序相反的顺序输出//用数组 #include<iostream>#include<cstdio>#pragma warning(disable : 4996) #define NUM 100 using namespace std; int 阅读全文
posted @ 2022-02-12 14:08 江南王小帅 阅读(173) 评论(0) 推荐(0)
摘要: //求阶乘的和//即1!+2!+3!+...n! using namespace std; int main() { int n, sum=0; cin >> n; for (int i = 1; i <= n; i++) { int factorial=1; //存放i阶乘 factorial * 阅读全文
posted @ 2022-02-12 11:20 江南王小帅 阅读(36) 评论(0) 推荐(0)
摘要: #include<iostream>#include<cstdio>#pragma warning(disable : 4996) //求阶乘的和//即1!+2!+3!+...n! using namespace std; int main() { int n, sum=0; cin >> n; f 阅读全文
posted @ 2022-02-12 11:16 江南王小帅 阅读(76) 评论(0) 推荐(0)
摘要: //斐波那契数列//输入第k项,输出数列值 using namespace std; int main() { int a1 = 1, a2 = 1;//a1是倒数第二项,a2是最后一项 int k; cin >> k; if (k==1 || k==2) { cout << 1 << endl; 阅读全文
posted @ 2022-02-12 10:45 江南王小帅 阅读(50) 评论(0) 推荐(0)
摘要: #include<iostream>#include<cstdio>#pragma warning(disable : 4996) //乘方计算using namespace std; int main() { int a, n; cin >> a >> n; int result = 1; for 阅读全文
posted @ 2022-02-12 09:39 江南王小帅 阅读(104) 评论(0) 推荐(0)
摘要: #include<iostream>#include<cstdio>#pragma warning(disable : 4996) //freopen 重定向输入//调试程序是,每次运行程序都需要输入测试数据,太麻烦//可以将测试数据存储文件,然后用freopen将输入由键盘重定向为文件//则运行程 阅读全文
posted @ 2022-02-12 09:33 江南王小帅 阅读(53) 评论(0) 推荐(0)
摘要: /读入若干个正整数 输出其中的最大值//处理无结束标记的OJ题目的输入 //连续按三次ctrl + z,并且每次^z都要在每行的首列!可以退出输入 using namespace std; int main() { int n, mx = 0; while (scanf("%d",&n)!=EOF) 阅读全文
posted @ 2022-02-12 09:10 江南王小帅 阅读(63) 评论(0) 推荐(0)
摘要: #include<iostream>#include<cstdio>#pragma warning(disable : 4996) using namespace std; int main() { int sum = 0, maxN = 0, minN = 200, n; cin >> n; wh 阅读全文
posted @ 2022-02-11 15:37 江南王小帅 阅读(55) 评论(0) 推荐(0)
摘要: #include<iostream>#include<cstdio>#pragma warning(disable : 4996)using namespace std; int main() { char a, b, c; scanf("%c%c%c", &a, &b, &c); printf(" 阅读全文
posted @ 2022-02-11 09:19 江南王小帅 阅读(48) 评论(0) 推荐(0)
摘要: int isprime(int n){ int i; for ( i = 2; i < n/2; i++) { if (n%i == 0) { return 0; } return 1; }}int main(){ int i; for ( i = 2; i <= 100; i++) { if (i 阅读全文
posted @ 2022-02-10 09:18 江南王小帅 阅读(192) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 29 下一页