摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 int n; 6 7 scanf("%d", &n); 8 9 for (int i = 1; i <= n; i++) 10 { 11 if (i % 2 == 1) 12 { 13 if ((i == n) 阅读全文
posted @ 2019-11-05 11:30 jason2018 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 int bjt; 6 7 scanf_s("%d", &bjt); 8 9 int bjt_hour = bjt / 100; 10 int bjt_minute = bjt % 100; 11 12 int 阅读全文
posted @ 2019-11-05 10:24 jason2018 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 int main(void) 4 { 5 int x; 6 int n = 0; 7 8 scanf_s("%d", &x); 9 10 x = x / 10; 11 n++; 12 13 while (x > 0) 14 { 15 x = x / 10; 16... 阅读全文
posted @ 2019-11-03 10:11 jason2018 阅读(569) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 double length; 6 int time; 7 double money; 8 9 scanf_s("%lf %d", &length, &time); 10 11 if (length <= 3) 12 { 13 money = 10; 14 } 15 else 16 { 17 if (lengt 阅读全文
posted @ 2019-11-03 09:23 jason2018 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 字符型常量用单引号。 阅读全文
posted @ 2019-11-01 16:42 jason2018 阅读(448) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 int num; 6 7 scanf_s("%d", &num); 8 9 printf("%d", num / 16 * 10 + num % 16); 10 11 12 return 0; 13 } 阅读全文
posted @ 2019-11-01 16:15 jason2018 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 int start; 6 int time; 7 8 scanf_s("%d %d", &start, &time); 9 10 int start_minute = start / 100 * 60 + start % 100; 11 int end_minute = start_minute + time 阅读全文
posted @ 2019-11-01 15:24 jason2018 阅读(716) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 int day, next; 6 7 scanf_s("%d", &day); 8 9 next = day + 2; 10 if (next > 7) //超过了7,就是下周了 11 { 12 next = next - 7; 13 } 14 printf("%d\n", next); 15 16 retu 阅读全文
posted @ 2019-11-01 15:08 jason2018 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 3 int main(void) 4 { 5 /* 6 true 1 7 false 0 8 */ 9 10 printf("%d\n", 5 == 3); 11 printf("%d\n", 5 > 3); 12 printf("%d\n", 5 <= 阅读全文
posted @ 2019-11-01 14:12 jason2018 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 控制输入输出的格式。 阅读全文
posted @ 2019-11-01 12:14 jason2018 阅读(117) 评论(0) 推荐(0) 编辑