摘要: #include /*围圈报数*/void left(int *p,int m,int n){ int i,j,count; i = j = count = 0; while(count < m-1) { if(*(p+i) != 0) ... 阅读全文
posted @ 2015-04-09 21:13 林海云 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 第一个:求N!结果中末尾0的个数问题。思路是末尾0的产生 5*偶数,阶乘中偶数的个数肯定比5多,所以求出阶乘中5的个数就可以求出末尾0的个数。 1 #include 2 3 int main(void) 4 { 5 int num,count,i,j; 6 i = c... 阅读全文
posted @ 2015-04-07 20:51 林海云 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1 输入两个数,第一个数决定一个nXn的矩阵,第二个数决定从1开始赋值,赋值的上限 2 3 比如: 4 5 输入:5 18 6 7 输出: 8 9 1 2 3 4 5 10 11 16 17 18 0 6 12 13 15 0 0 0 7 14 ... 阅读全文
posted @ 2015-04-05 15:07 林海云 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 int main(void) 3 { 4 int n,i; 5 scanf("%d",&n); 6 printf("%d=",n); 7 for (i=2;i<=n;i++) 8 { 9 while(n%i==0&... 阅读全文
posted @ 2015-04-04 18:56 林海云 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 1 输入一个大写字符,如F 2 3 比如: 4 5 输入:F 6 7 输出: 8 9 FEDCBA 10 11 EDCBAB12 13 DCBABC14 15 CBABCD16 17 BABCDE18 19 ABCDEF20 21 22 23 输入 B24... 阅读全文
posted @ 2015-04-04 17:37 林海云 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1 输入一个大写字母,如 F,输出 2 3 比如: 4 5 输入:F 6 7 输出: 8 9 F10 11 EFE12 13 DEFED14 15 CDEFEDC16 17 BCDEFEDCB18 19 ABCDEFEDCBA20 21 #include2... 阅读全文
posted @ 2015-04-04 17:35 林海云 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 输出数字序列2/1,3/2,5/3,8/5,13/8,21/13...,输出个数由键盘输入。注意输入使用scanf输入 比如:输入 3输出为2/13/25/3输入 4 输出为2/13/25/38/5#includeint func(int n){ if(n == 1) { ... 阅读全文
posted @ 2015-04-04 17:30 林海云 阅读(1911) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i,j; for(i=1;i<=9;i++) { for(j=1;j<=i;j++) { printf("%d*%d=%-3d",j,i,i*j); } printf(... 阅读全文
posted @ 2015-04-04 17:19 林海云 阅读(307) 评论(0) 推荐(0) 编辑
摘要: #include#include//整数逆序输出void nixu(){ int num,i; i = 0; scanf("%d",&num); int converse = 0; while(num>0) { i = num % 10; ... 阅读全文
posted @ 2015-04-04 17:15 林海云 阅读(469) 评论(0) 推荐(0) 编辑
摘要: #include#include//水仙花数--各位立方和等于本身void sXh(){ int x,y,z; printf("查找出三位数的水仙花数\n"); for(int i=100; i<=999; i++) { x = i/100; y ... 阅读全文
posted @ 2015-04-04 17:08 林海云 阅读(626) 评论(0) 推荐(0) 编辑