上一页 1 ··· 243 244 245 246 247 248 249 250 251 ··· 367 下一页
摘要: 测试程序1: #include <stdio.h> int main(void) { char ch; printf("please input an character: \n"); while((ch = getchar()) != '#') printf("xxx\n"); return 0; 阅读全文
posted @ 2021-08-25 23:07 小鲨鱼2018 阅读(366) 评论(0) 推荐(0) 编辑
摘要: c语言中使用程序读取文件。 #include <stdio.h> #include <stdlib.h> int main() { int ch; FILE * fp; char fname[50]; printf("enter the name of the file: "); scanf("%s 阅读全文
posted @ 2021-08-25 01:31 小鲨鱼2018 阅读(574) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #include <ctype.h> int main(void) { char ch; int n_space = 0, n_lines = 0, n_other = 0; while((ch = getchar()) != '#') { if(ch = 阅读全文
posted @ 2021-08-23 00:25 小鲨鱼2018 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #include <ctype.h> #include <stdbool.h> #define STOP '|' int main(void) { char ch; char prep; long n_ch = 0L; int n_lines = 0; i 阅读全文
posted @ 2021-08-22 15:26 小鲨鱼2018 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #define STOP '|' int main(void) { char ch; int chnum = 0; int lines = 0; while((ch = getchar()) != STOP) { if(ch != '\n') chnum+ 阅读全文
posted @ 2021-08-22 12:41 小鲨鱼2018 阅读(785) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { char ch; ch = getchar(); while(ch != '\n') { if(ch == ' ') { putchar(ch); } else { putchar(ch + 1); } ch = getc 阅读全文
posted @ 2021-08-21 20:36 小鲨鱼2018 阅读(807) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #define NUM 26 int main(void) { char letters[NUM]; int i; for(i = 0; i < NUM; i++) { letters[i] = 'a' + i; } for(i = 0; i < NUM; 阅读全文
posted @ 2021-08-16 00:16 小鲨鱼2018 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { char ch; scanf("%c", &ch); while(ch != 'g') { printf("%c", ch); scanf("%c", &ch); } return 0; } 阅读全文
posted @ 2021-08-15 23:08 小鲨鱼2018 阅读(1385) 评论(0) 推荐(0) 编辑
摘要: c语言中复合赋值运算符的等级低于普通赋值运算符。 #include <stdio.h> int main(void) { int num1 = 2; int num2 = 2; num1 *= 3 + 8; // 等价于 num1 = num1 * (3 + 8);说明复合赋值运算符的优先级等于算术 阅读全文
posted @ 2021-08-15 01:19 小鲨鱼2018 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #define M_PER_HOUR 60 int main(void) { int min; int hour, min_left; printf("please input the minutes to convert: "); scanf("%d", 阅读全文
posted @ 2021-08-12 23:28 小鲨鱼2018 阅读(48) 评论(0) 推荐(0) 编辑
上一页 1 ··· 243 244 245 246 247 248 249 250 251 ··· 367 下一页