上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页
摘要: 写了两个函数。 1 int even( int n ) 2 { 3 int ret = 1; 4 5 if (n < 0) 6 { 7 n = -n; 8 } 9 if (n % 2 == 1) 10 { 11 ret = 0; 12 } 13 14 return ret; 15 } 16 int 阅读全文
posted @ 2019-12-02 16:41 jason2018 阅读(1233) 评论(0) 推荐(0) 编辑
摘要: 程序只验证了样例 1 #include<stdio.h> 2 3 int q, r; //全局变量 4 int div(int a, int b); 5 int main(void) 6 { 7 int a, b; 8 int count = 0; 9 10 scanf("%d/%d", &a, & 阅读全文
posted @ 2019-12-02 16:07 jason2018 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 4 int array_in(int x, int a[], int n); 5 6 int main(void) 7 { 8 int m, n, k; //三个数组的大小 9 10 /*第一个数组,数组长度是变量,C99支持,但vs不支持*/ 11 sc 阅读全文
posted @ 2019-12-02 14:35 jason2018 阅读(3512) 评论(0) 推荐(0) 编辑
摘要: 查找最小数下标 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 阅读(108) 评论(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 阅读(446) 评论(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 阅读(102) 评论(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 阅读(184) 评论(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 阅读(214) 评论(0) 推荐(0) 编辑
摘要: /* 计算序列部分和 1 - 1/4 + 1/7 - 1/10 + ... 直到最后一项的绝对值不大于给定精度eps。 输入格式: 输入在一行中给出一个正实数eps。 输出格式: 在一行中按照“sum = S”的格式输出部分和的值S,精确到小数点后六位。题目保证计算结果不超过双精度范围。 */ #i 阅读全文
posted @ 2019-11-13 15:01 jason2018 阅读(982) 评论(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 阅读(181) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页