上一页 1 ··· 305 306 307 308 309 310 311 312 313 ··· 367 下一页
摘要: 1、虽然通过对象式宏来变更元素的数目非常方便,但是每次都需要对程序进行修改,然后重新编译执行。 我们可以定义一个比较大的数组,然后从头开始仅使用其中需要的部分。 #include <stdio.h> #define NUMBER 80 int main(void) { int i, j; int a 阅读全文
posted @ 2021-03-22 10:58 小鲨鱼2018 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #define NUMBER 4 int main(void) { int i; int a[NUMBER]; int sum = 0; puts("please input the scores."); for (i = 0; i < NUMBER; i 阅读全文
posted @ 2021-03-21 18:29 小鲨鱼2018 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { int num, i = 0, sum = 0, tmp; puts("please input the num."); printf("num = "); scanf("%d", &num); while (i < nu 阅读全文
posted @ 2021-03-21 09:16 小鲨鱼2018 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { int i = 1, j; puts("please input an integer!"); printf("j = "); scanf("%d", &j); for ( i = 1; i <= j; i++) { if 阅读全文
posted @ 2021-03-21 09:06 小鲨鱼2018 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { int i, j; puts("please input an integer!"); printf("j = "); scanf("%d", &j); for (i = 1; i <= j; i++ ) { if (j 阅读全文
posted @ 2021-03-16 22:57 小鲨鱼2018 阅读(657) 评论(0) 推荐(0) 编辑
摘要: 1、 偶数: #include <stdio.h> int main(void) { int i,j; puts("please input an integer!"); printf("j = "); scanf("%d", &j); for (i = 1; i <= j; i++) { if ( 阅读全文
posted @ 2021-03-16 22:45 小鲨鱼2018 阅读(1152) 评论(0) 推荐(0) 编辑
摘要: c语言中程序的循环控制(while语句、for语句实现程序循环特定的次数) 1、while语句 #include <stdio.h> int main(void) { int i; puts("please input an integer!"); printf("i = "); scanf("%d 阅读全文
posted @ 2021-03-15 23:02 小鲨鱼2018 阅读(654) 评论(0) 推荐(0) 编辑
摘要: c语言中程序的循环控制,while语句和for语句实现正整数固定次数的递增。 1、while语句 #include <stdio.h> int main(void) { int i = 0, j; puts("please input an integer!"); printf("j = "); s 阅读全文
posted @ 2021-03-15 22:39 小鲨鱼2018 阅读(466) 评论(0) 推荐(0) 编辑
摘要: c语言中程序的循环控制,(do while, while语句实现正整数的逆向输出) 1、 #include <stdio.h> int main(void) { int i; do ## do语句实现程序的循环控制,限定用户的输入范围 { printf("i = "); scanf("%d", &i 阅读全文
posted @ 2021-03-15 22:00 小鲨鱼2018 阅读(845) 评论(0) 推荐(0) 编辑
摘要: 1、 符合赋值运算符:a = a + 1, 表示将a增加1,并将结果赋值给a。 后置递增运算符:a++, 表示将a增加1,该表达式的值为递增之前的值。 前置递增运算符:++a,表示将a增加1,该表达式的值为递增之后的值。 符合赋值运算符: a = a - 1, 表示将a的值减少1,并将结果赋值给a。 阅读全文
posted @ 2021-03-15 18:12 小鲨鱼2018 阅读(556) 评论(0) 推荐(0) 编辑
上一页 1 ··· 305 306 307 308 309 310 311 312 313 ··· 367 下一页