11 2019 档案

摘要:查找最小数下标 1 #include<stdio.h> 2 3 int main() 4 { 5 int a[10]; //定义一个数组 6 int n; //参加排序整数的个数,小于等于10 7 int temp; 8 9 scanf_s("%d", &n); 10 11 for (int i = 阅读全文
posted @ 2019-11-29 09:32 jason2018 阅读(113) 评论(0) 推荐(0) 编辑
摘要:1 #include<stdio.h> 2 3 int main(void) 4 { 5 char ch; 6 int number; 7 int flag = 0; 8 int ret; 9 10 scanf("%d", &number); //读入一个数字 11 ret = number; // 阅读全文
posted @ 2019-11-28 08:31 jason2018 阅读(454) 评论(0) 推荐(0) 编辑
摘要:1 #include<stdio.h> 2 3 int pow(int m, int n); 4 int main(void) 5 { 6 int n; 7 int temp; //n的绝对值 8 int count; //数的位数 9 int x; //临时变量 10 11 count = 0; 阅读全文
posted @ 2019-11-25 14:27 jason2018 阅读(105) 评论(0) 推荐(0) 编辑
摘要:1 #include<stdio.h> 2 3 int main(void) 4 { 5 int n, m; 6 int i; 7 int isPrime; 8 int sum; 9 int count; 10 11 i = 2; //第一个素数 12 sum = 0; 13 count = 0; 阅读全文
posted @ 2019-11-25 13:05 jason2018 阅读(190) 评论(0) 推荐(0) 编辑
摘要:1 #include<stdio.h> 2 #include<math.h> 3 4 int main(void) 5 { 6 int n; 7 int temp; //个位数 8 int flag; //奇偶标志位,1是奇数,0是偶数 9 int count; //统计数的位数 10 int re 阅读全文
posted @ 2019-11-25 12:27 jason2018 阅读(217) 评论(0) 推荐(0) 编辑
摘要:/* 计算序列部分和 1 - 1/4 + 1/7 - 1/10 + ... 直到最后一项的绝对值不大于给定精度eps。 输入格式: 输入在一行中给出一个正实数eps。 输出格式: 在一行中按照“sum = S”的格式输出部分和的值S,精确到小数点后六位。题目保证计算结果不超过双精度范围。 */ #i 阅读全文
posted @ 2019-11-13 15:01 jason2018 阅读(1005) 评论(0) 推荐(0) 编辑
摘要:1 #include<stdio.h> 2 3 int main(void) 4 { 5 int year; 6 int month; 7 int day; 8 int a[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 9 int 阅读全文
posted @ 2019-11-05 15:22 jason2018 阅读(193) 评论(0) 推荐(0) 编辑
摘要: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 阅读(370) 评论(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 阅读(166) 评论(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 阅读(602) 评论(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 阅读(134) 评论(0) 推荐(0) 编辑
摘要:字符型常量用单引号。 阅读全文
posted @ 2019-11-01 16:42 jason2018 阅读(492) 评论(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 阅读(218) 评论(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 阅读(729) 评论(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 阅读(121) 评论(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 阅读(229) 评论(0) 推荐(0) 编辑
摘要:控制输入输出的格式。 阅读全文
posted @ 2019-11-01 12:14 jason2018 阅读(118) 评论(0) 推荐(0) 编辑
摘要:1 #include<stdio.h> 2 3 int main(void) 4 { 5 int a = 0; 6 int b = 0; 7 8 scanf_s("%d %d", &a, &b); 9 10 printf("%d + %d = %d\n", a, b, a + b); 11 printf("%d - %d = %d\n", a, b, a - b); 12 printf("%d * 阅读全文
posted @ 2019-11-01 10:59 jason2018 阅读(836) 评论(0) 推荐(0) 编辑
摘要:参考这个博客,https://blog.csdn.net/sinat_40936062/article/details/84348021 阅读全文
posted @ 2019-11-01 10:07 jason2018 阅读(247) 评论(0) 推荐(0) 编辑
摘要:从浮点数中分离出整数部分和小数部分。 阅读全文
posted @ 2019-11-01 09:52 jason2018 阅读(879) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示