摘要: 任务3 是,是 任务4 子任务1 是 是 不可读 子任务2 #include <stdio.h> #include <stdlib.h> int main(){ char ch; FILE *fin; fin=fopen("file4.dat","rb"); if(!fin){ printf("fa 阅读全文
posted @ 2020-12-29 15:31 asmallrookie 阅读(64) 评论(1) 推荐(0)
摘要: 任务1 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 typedef struct student { int id; char name[20]; char subject[20]; float perf; 阅读全文
posted @ 2020-12-21 23:11 asmallrookie 阅读(73) 评论(1) 推荐(0)
摘要: 任务1 #include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", & 阅读全文
posted @ 2020-12-10 22:04 asmallrookie 阅读(71) 评论(1) 推荐(0)
摘要: 任务1 return每次只能返回一个值给主函数,所以可以通过全局变量返回给主函数 任务2 #include<stdio.h> long long fac(int n); int main(){ int i,n; printf("Enter n: "); scanf("%d",&n); for(i=1 阅读全文
posted @ 2020-11-29 21:41 asmallrookie 阅读(77) 评论(1) 推荐(0)
摘要: //一元二次方程求解 //重复执行,直到按CTRL+Z结束 // #include<stdio.h> #include<math.h> int main(){ float a,b,c,x1,x2; float delta,real,imag; printf("Enter a, b, c: "); w 阅读全文
posted @ 2020-11-11 19:05 asmallrookie 阅读(104) 评论(1) 推荐(0)
摘要: 任务1 #include<stdio.h> int main(){ int a=5,b=7,c=100,d,e,f; d=a/b*c; e=a*c/b; f=c/b*a; printf("d=%d,e=%d,f=%d\n",d,e,f); return 0; } 小数部分计算的时候会被去除 任务2 阅读全文
posted @ 2020-11-01 20:35 asmallrookie 阅读(98) 评论(3) 推荐(0)
摘要: /*A simple C program*/ #include<stdio.h> int main(){ printf("my stuno is 202083290275\n"); printf("2020,stop to be a small rookie"); return 0 ; } 任务2 阅读全文
posted @ 2020-10-15 21:49 asmallrookie 阅读(78) 评论(2) 推荐(0)