上一页 1 ··· 280 281 282 283 284 285 286 287 288 ··· 403 下一页
摘要: 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 阅读(1621) 评论(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 阅读(58) 评论(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 阅读(216) 评论(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 阅读(4121) 评论(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 阅读(379) 评论(0) 推荐(0)
摘要: \0oo: 用八进制数表示字符,o必须为有效的八进制数(0-7), 也可以写成 \oo的形式。 1、 #include <stdio.h> int main(void) { printf("test1: %c.\n", '\041'); // 八进制数的41表示十进制数33 printf("test 阅读全文
posted @ 2021-08-09 01:25 小鲨鱼2018 阅读(2214) 评论(0) 推荐(0)
摘要: c语言中printf()函数也有一个返回值,它返回打印字符的个数。 #include <stdio.h> int main(void) { int num = 10; int count; count = printf("num:%d\n", num); //printf()函数的返回值是打印字符的 阅读全文
posted @ 2021-08-07 23:45 小鲨鱼2018 阅读(1269) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #define TEST 58 //符号常量or对象式宏 int main(void) { printf("|%d|\n", TEST); printf("|%5d|\n", TEST); //5表示宽度 printf("|%-5d|\n", TEST); 阅读全文
posted @ 2021-08-07 20:56 小鲨鱼2018 阅读(408) 评论(0) 推荐(0)
摘要: 1、 阅读全文
posted @ 2021-08-07 17:36 小鲨鱼2018 阅读(55) 评论(0) 推荐(0)
上一页 1 ··· 280 281 282 283 284 285 286 287 288 ··· 403 下一页