上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 22 下一页
摘要: 1 #include<stdio.h> 2 3 int search(int key, int a[], int len); 4 int main(void) 5 { 6 int a[] = { 1,3,6,7,8,9,10,11,13 }; 7 int k = 11; //需要找的数 8 int 阅读全文
posted @ 2019-12-10 15:47 jason2018 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 查找美分对应的英文单词 1、用两个数组 1 #include<stdio.h> 2 3 int amount[] = { 1,5,10,25,50 }; 4 char* name[] = { "penny","mickel","dimme","quarter","half-dollar" }; 5 阅读全文
posted @ 2019-12-10 11:29 jason2018 阅读(650) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 构造素数表 3 思路: 4 欲构造n以内的素数表 5 1、令x为2 6 2、将2x、3x、4x直至ax<n的数标记为非素数 7 3、令y为下一个没有被标记为非素数的数,重复第二步; 8 4、直到所有的数都已经尝试完毕 9 10 伪代码: 11 欲构造n以内(不含)的素数表 12 1、开 阅读全文
posted @ 2019-12-10 10:44 jason2018 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 浙大慕课程序 1 /*判断是否能被已知的且<x的素数整除*/ 2 #include<stdio.h> 3 4 int main(void) 5 { 6 int prime[10] = { 2 }; //初始化素数表 7 int count = 1; 8 int i = 3; //从3开始,判断素数 阅读全文
posted @ 2019-12-10 08:51 jason2018 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 32位 64位 阅读全文
posted @ 2019-12-09 15:43 jason2018 阅读(490) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int is_hex(char ch); //判断是否是十六进制字符,是返回1 4 int hex_to_dec(char ch); //十六进制字符转换位十进制数 5 int main(void) 6 { 7 char a[80], b[80]; 8 阅读全文
posted @ 2019-12-09 15:15 jason2018 阅读(2117) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 char a[80], b[80]; 6 int i; 7 8 i = 0; //有效字符的个数 9 10 while (i < 80) 11 { 12 a[i] = getchar(); 13 if (a[i 阅读全文
posted @ 2019-12-09 12:02 jason2018 阅读(827) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 char a[80]; 6 int i; 7 8 i = 0; 9 while ((a[i] = getchar()) != '\n') 10 { 11 i++; 12 } 13 a[i] = '\0'; 14 阅读全文
posted @ 2019-12-09 10:13 jason2018 阅读(932) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 int n; 6 int a[6][6]; 7 int row_max[6]; //每 一行的最大数 8 int col_min[6]; //每一列的最大数 9 10 scanf_s("%d", &n); 11 阅读全文
posted @ 2019-12-09 09:09 jason2018 阅读(718) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 printf("%d %o %x\n", 10, 10, 10); //输出八进制是%o,不是0 6 printf("%d %o %X\n", 10, 10, 10); //%X,大写的X,输出的十六进制数值也 阅读全文
posted @ 2019-12-08 18:09 jason2018 阅读(224) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 22 下一页