摘要: 任务3 输出的数据是按照从高到低排序 生成了file3 且直观可读且正确 任务4 子1 是按照从高到低的顺序排序的 生成了file4 但不可直观 一堆乱码 子2 //4.22 #include <stdio.h> #include <stdlib.h> #define N 10 typedef st 阅读全文
posted @ 2020-12-30 21:19 王舟 阅读(83) 评论(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-20 11:05 王舟 阅读(90) 评论(1) 推荐(0)
摘要: 任务1 //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-15 22:45 王舟 阅读(55) 评论(1) 推荐(0)
摘要: 任务1 可是使用数组变量和指针变量 任务2 //2.1 #include<stdio.h> long long fac(int n); int main(){ int i,n; printf("Enter n:"); scanf("%d",&n); for(i=1;i<=n;i++) printf( 阅读全文
posted @ 2020-11-28 22:02 王舟 阅读(73) 评论(1) 推荐(0)
摘要: // 一元二次方程求解 //ctrl+z结束 #include <math.h> #include <stdio.h> int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, b, c: "); wh 阅读全文
posted @ 2020-11-19 00:22 王舟 阅读(83) 评论(2) 推荐(0)
摘要: // 1 .cpp #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; } a/b* 阅读全文
posted @ 2020-11-02 17:13 王舟 阅读(62) 评论(4) 推荐(0)
摘要: /*A simple C program*/ #include<stdio.h> int main(){ printf("my stuno is:202083290261\n"); printf("2020,give me an answer?\n"); return 0; } /*循环打印字符*/ 阅读全文
posted @ 2020-10-17 17:00 王舟 阅读(69) 评论(0) 推荐(0)