上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页
摘要: https://pintia.cn/problem-sets/12/problems/353 1 double calc_pow(double x, int n) 2 { 3 double ret; 4 5 if (n == 0) 6 { 7 ret = 1; 8 } 9 else 10 { 11 阅读全文
posted @ 2020-01-25 20:33 jason2018 阅读(537) 评论(0) 推荐(0) 编辑
摘要: https://pintia.cn/problem-sets/12/problems/352 1 double fact(int n) 2 { 3 double product; 4 if (n == 0) 5 { 6 product = 1; 7 } 8 else 9 { 10 product = 阅读全文
posted @ 2020-01-25 20:19 jason2018 阅读(608) 评论(0) 推荐(0) 编辑
摘要: https://pintia.cn/problem-sets/12/problems/351 1 int search(int n) 2 { 3 int count = 0; 4 int num_sqrt; //平方根的整数部分 5 int single, ten, hundred; 6 for ( 阅读全文
posted @ 2020-01-25 20:05 jason2018 阅读(630) 评论(0) 推荐(0) 编辑
摘要: https://pintia.cn/problem-sets/12/problems/350 1 int sum(int n) 2 { 3 if (n <= 0) 4 { 5 return 0; 6 } 7 else 8 { 9 return n + sum(n - 1); 10 } 11 } 阅读全文
posted @ 2020-01-17 14:28 jason2018 阅读(1466) 评论(0) 推荐(0) 编辑
摘要: https://pintia.cn/problem-sets/12/problems/347 1 #include <stdio.h> 2 #include <stdlib.h> 3 struct friend 4 { 5 char name[11]; 6 int birthday; 7 char 阅读全文
posted @ 2020-01-17 14:17 jason2018 阅读(656) 评论(0) 推荐(0) 编辑
摘要: https://pintia.cn/problem-sets/12/problems/349 1 int set_grade(struct student *p, int n) 2 { 3 int i, count; 4 5 count = 0; 6 for (i = 0; i < n; i++) 阅读全文
posted @ 2020-01-17 12:29 jason2018 阅读(456) 评论(0) 推荐(0) 编辑
摘要: https://pintia.cn/problem-sets/12/problems/348 1 struct complex multiply(struct complex x, struct complex y) 2 { 3 struct complex ret; 4 5 ret.real = 阅读全文
posted @ 2020-01-17 12:17 jason2018 阅读(884) 评论(0) 推荐(0) 编辑
摘要: 1 /*修改学生成绩,结构指针作为函数参数*/ 2 #include <stdio.h> 3 struct student 4 { 5 int num; 6 char name[10]; 7 int computer, english, math; 8 double average; 9 }; 10 阅读全文
posted @ 2020-01-17 09:11 jason2018 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 int main(void) 3 { 4 int a; 5 char c; 6 7 scanf("%d", &a); 8 c = getchar(); 9 putchar(c); 10 11 return 0; 12 } 输入1,然后回车 整数1读入到变 阅读全文
posted @ 2020-01-17 08:27 jason2018 阅读(84) 评论(0) 推荐(0) 编辑
摘要: https://pintia.cn/problem-sets/12/problems/346 这个程序的算法不难,因为没有学透标准输入和输出,特别是gets()函数。如果不用getchar()读取多余的'\n',程序就会运行错误。 1 #include <stdio.h> 2 #include <s 阅读全文
posted @ 2020-01-16 20:45 jason2018 阅读(142) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页