上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 27 下一页
摘要: 1.写两个函数,分别求两个整数的最大公约数和最小公倍数,用主函数调用这两个函数,并输出结果。两个整数由键盘输入。 #include <stdio.h> #include <math.h> int gcd(int m,int n){ int t,r; if(m<n){ t=m; m=n; n=t; } 阅读全文
posted @ 2020-10-20 20:07 薄眠抛却陈年事。 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1.从键盘输入一个字符串,将其中的小写字母全部转化成大写字母然后输出到一个磁盘文件test中保存,输入的字符串以!结束 fgetc(fp):从fp指向的文件读入一个字符 读成功带回所读的字符,失败则返回文件结束标志EOF(即-1)fputc(ch,fp):把字符ch写到文件指针变量fp所指向的文件中 阅读全文
posted @ 2020-10-17 14:43 薄眠抛却陈年事。 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1:定义一个结构体变量(包括年,月,日)。计算该日在本年中是第几天注意闰年的问题 #include <stdio.h> #include <math.h> struct Date{ int y; int m; int d; } date; //判断是否是闰年 int IsYear(int year) 阅读全文
posted @ 2020-10-15 11:04 薄眠抛却陈年事。 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 第一题: #include <stdio.h> #include <math.h> #define N 10 int a[N]; int Stand(int num);//判断数字是否符合标准 int NumLen(int num);//获取数字的长度,并将每一位写入数组 void print(in 阅读全文
posted @ 2020-10-14 12:50 薄眠抛却陈年事。 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 第一题: #include <stdio.h> #include <math.h> void deal(int a,int b,int c){ if(a==0&&b==0&&c==0) printf("a=%d,b=%d,c=%d时方程为无穷解\n",a,b,c); else if(a==0&&b= 阅读全文
posted @ 2020-10-14 12:46 薄眠抛却陈年事。 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 第一题: #include <stdio.h> #include <math.h> int LAdd(int k); int NAdd(int k); double DAdd(int k); int main(){ int n1=100,n2=50,n3=10; printf("值=%lf\n",L 阅读全文
posted @ 2020-10-13 13:46 薄眠抛却陈年事。 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 第一题: #include <stdio.h> #include <math.h> char str[100]; void ToUpper(){ int i; for(i=0;str[i]!='\0';i++){ if(str[i]>='a'&&str[i]<='z') str[i]=str[i]- 阅读全文
posted @ 2020-10-13 11:00 薄眠抛却陈年事。 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 第一题: #include <stdio.h> #include <math.h> #define N 10 int a[N]; int Stand(int num);//判断数字是否符合标准 int NumLen(int num);//获取数字的长度,并将每一位写入数组 void print(in 阅读全文
posted @ 2020-10-13 00:53 薄眠抛却陈年事。 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 第二题: #include <stdio.h> #include <math.h> int main(){ float sum = 0, count = 1.0; int i = 1; while(fabs(1.0/count) > 1e-6){ if(i%2){ sum += 1.0/count; 阅读全文
posted @ 2020-10-11 23:27 薄眠抛却陈年事。 阅读(218) 评论(0) 推荐(1) 编辑
摘要: 第一题: #include <stdio.h> double fun(int n,double x){ if(n==0) return 1; else if(n==1) return 2*x; else return 2*x*fun(n-1,x)-2*(n-1)*fun(n-2,x); } int 阅读全文
posted @ 2020-10-10 23:46 薄眠抛却陈年事。 阅读(236) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 27 下一页