摘要: #include <stdio.h> //http://www.china-audit.com/lhd_4awla5u6mp47ty70kclt55mbv23rb1005bb_1.html //实现输入两个数字,若两数相等,则直接输出两个数字;若不相等,则这两个数中的 //较大者等于这个较大者减去较 阅读全文
posted @ 2023-02-11 14:45 myrj 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //键盘输入任意整数,判断其是否为质数 int pdzs(int n) { int a; if(n==1) return 0; for(a=2;a<n;a++) if(n%a==0) return 0; return 1; } main() { int a=1, 阅读全文
posted @ 2023-02-11 14:34 myrj 阅读(292) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //输入5个1-9之间的整数,输出由这五个数能组成的最大值和最小值。 main() { int a[5],i,j,temp,【1】; for(i=0;i<5;i++) scanf("%d",&a[i]); for(i=0;i<4;i++) for(j=【2】;j 阅读全文
posted @ 2023-02-11 09:52 myrj 阅读(226) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //输入一行英文,输出单词个数 //输入一行字符串,由英语单词和若干空格组成,输出单词个数。(约定第一个单词前和最后一个单词后没有空格,输入最多100个字符) #include <string.h> main() { char zf[101]; int a,b, 阅读全文
posted @ 2023-02-11 09:27 myrj 阅读(70) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //输人一个5行5列的二维数组,将其按行存储在一个一维数组中并输出。 main() { int a[5][5],b[25],c,d,e=0; for(c=0;c<5;c++) for(d=0;d<5;d++) { scanf("%d",&a[c][d]); b[ 阅读全文
posted @ 2023-02-11 09:25 myrj 阅读(380) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //哥德巴赫猜想是指任一大于2的偶数都可写成两个素数之和,请输入任何一个大于2的偶数,将其分解为两个素数之和并输出, //输出格式如下:如输入8,则输出:8=3+5,有多个结果的只输出一个即可,注意1不是素数,故不能输出8=1+7, //如输入非法则给出提示,本 阅读全文
posted @ 2023-02-11 09:22 myrj 阅读(796) 评论(0) 推荐(0) 编辑
摘要: #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) 编辑