摘要:
3. 输出了按分数由高→低排序的信息;生成了文本文件file3.dat;数据信息正确且直观可读 4. (1) 屏幕上正确输出了按分数由高到底排序的学生信息,生成了二进制文件file4.dat。 用记事本打开文件,不直观可读。 (2) #include <stdio.h> #include <stdl 阅读全文
摘要:
#include <stdio.h> #include <string.h> #define N 3 //Task 1 typedef struct student { int id; char name[20]; char subject[20]; float perf; float mid; f 阅读全文
摘要:
#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", &a[i] 阅读全文
摘要:
任务一 应该是不能的,return返回来是一个值,而根可能有2个 任务2 #include <stdio.h> long long fac(int n); int main() { int i,n; printf("Enter n: "); scanf("%d", &n); for(i=1; i<= 阅读全文
摘要:
//一元二次方程求解 #include <math.h> #include <stdio.h> int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, b, c: "); while(scanf("% 阅读全文
摘要:
//ex1 #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); getchar(); return 0; } int定 阅读全文
摘要:
//a simple c program #include<stdio.h> int main(){ printf("202083450090\n"); printf("lazy,crazy,angry"); return 0; } //循环打印字符 #include<stdio.h> int ma 阅读全文