上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 180 下一页
摘要: #include <stdio.h> //程序功能:将任意字符串转置并输出 #include <【1】> main() { char c[20]; int i=0,j; char ch; 【2】; j=【3】; while(【4】) { ch=c[i]; c[i]=c[j-1]; c[j-1]=ch 阅读全文
posted @ 2023-02-11 08:55 myrj 阅读(185) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //a b c均为一位整数,求当三位整数abc+cba=1333时的a,b,c的值 main() { int a,b,c; for(a=1;【1】;a++) for(【2】;b<=9;b++) for(【3】;c<=9;c++) if(【4】) printf(" 阅读全文
posted @ 2023-02-11 08:49 myrj 阅读(49) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //程序功能: 判断输入字符串是不是手机号 //【1】写最少的数 #include <string.h> main() { char zf[【1】],ch; int a,【2】,c; 【3】; c=【4】; if(【5】 || 【6】) b=1; for(a=0 阅读全文
posted @ 2023-02-11 08:27 myrj 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //键盘输入任意整数,判断其是否为质数 int pdzs(int n) { int a; for(a=2;a<n;a++) if(n%a==0) 【1】; 【2】; } main() { int a; scanf("%d",&a); if(【3】) printf 阅读全文
posted @ 2023-02-10 15:02 myrj 阅读(73) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //<<九章算术>>更相减损法: 可以用来求两个数的最大公约数,即“可半者半之,不可半者,副置分母、子之数,以少减多,更相减损,求其等也。 //以等数约之。 ///第一步:任意给定两个正整数;判断它们是否都是偶数。若是,则用2约简;若不是则执行第二步。 //第二 阅读全文
posted @ 2023-02-10 10:32 myrj 阅读(18) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //求最大公约数:辗转相除法:辗转相除法是求两个自然数的最大公约数的一种方法,也叫欧几里德算法。 //319 377:319%377=319 377%319=58 319%58=29 58%29=0 29为最大公约数 main() { int a=319,b=3 阅读全文
posted @ 2023-02-10 09:55 myrj 阅读(44) 评论(0) 推荐(0) 编辑
摘要: //求最大公约数 #include <stdio.h> int gys(int m,int n) { int i,k; k=【1】?m:n; for(i=k;i>=1;i--) { if(【1】) { return 【1】; break; } } } main() { int m,n,i,k; sc 阅读全文
posted @ 2023-02-10 09:50 myrj 阅读(61) 评论(0) 推荐(0) 编辑
摘要: //求最大公约数 #include <stdio.h> main() { int m,n,i,k; scanf("%d,%d",【1】); k=【2】?m:n; for(i=k;i>=1;i--) { if(【3】) { printf("最大公约数为%d\n",【4】); break; } } ge 阅读全文
posted @ 2023-02-10 09:41 myrj 阅读(29) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //计算1到5的阶乘和,并将结果保存到变量s中 main() { int a,s=【1】,b=【2】; for(a=1;a<=【3】;a++) { b=b*a; s【4】=【5】; } printf("1-5阶乘的和为:%d",s); getchar(); } 阅读全文
posted @ 2023-02-10 09:35 myrj 阅读(188) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //执行程序段后,变量s的值为() main() { int a=10,s=0; do { s=s+a; a++; } while(a<1); getchar(); } #include <stdio.h> //执行程序段后,变量s的值为(10) main() 阅读全文
posted @ 2023-02-10 09:25 myrj 阅读(19) 评论(0) 推荐(0) 编辑
上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 180 下一页