上一页 1 ··· 284 285 286 287 288 289 290 291 292 ··· 408 下一页
摘要: 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 阅读(440) 评论(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 阅读(915) 评论(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 阅读(964) 评论(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 阅读(77) 评论(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 阅读(1637) 评论(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 阅读(595) 评论(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 阅读(62) 评论(0) 推荐(0)
摘要: c语言中指数增长程序。 #include <stdio.h> #define SQUARES 64 int main(void) { const double CROP = 2E16; double current, total; int count = 1; printf("square grai 阅读全文
posted @ 2021-08-10 00:49 小鲨鱼2018 阅读(224) 评论(0) 推荐(0)
摘要: c语言中的指数运算。 #include <stdio.h> #include <math.h> int main(void) { float tmp; tmp = pow(2,3); printf("pwo(2,3) = %f.\n", tmp); return 0; } 阅读全文
posted @ 2021-08-09 23:53 小鲨鱼2018 阅读(4127) 评论(0) 推荐(0)
摘要: 1、编写一个程序,提示用户输入名和姓, 然后以“名,姓”的格式打印出来。 #include <stdio.h> int main(void) { char name[128]; char surname[128]; printf("please input your name: "); scanf( 阅读全文
posted @ 2021-08-09 22:06 小鲨鱼2018 阅读(386) 评论(0) 推荐(0)
上一页 1 ··· 284 285 286 287 288 289 290 291 292 ··· 408 下一页