摘要: task 4 #include<stdio.h> int main(){ int count; char ch; FILE *fp; fp=fopen("data4.txt","r"); if (fp==NULL){ printf("fail to open file\n"); return 1; 阅读全文
posted @ 2024-06-23 17:14 王思涵 阅读(22) 评论(0) 推荐(0)
摘要: task 1 #define N 3 // 运行程序输入测试时,可以把这个数组改小一些输入测试 #include<stdlib.h> typedef struct student { int id; // 学号 char name[20]; // 姓名 char subject[20]; // 考试 阅读全文
posted @ 2024-06-09 21:38 王思涵 阅读(23) 评论(0) 推荐(0)
摘要: #include<stdio.h> #define N 5 void input(int x[],int n); void output(int x[],int n); void find_min_max(int x[],int n,int *pmin,int *pmax); int main() 阅读全文
posted @ 2024-05-26 22:28 王思涵 阅读(38) 评论(0) 推荐(0)
摘要: #include<stdio.h> #define N 4 void test1() { int a[N]={1,9,8,4}; int i; //输出数组a占用的内存字节数 printf("sizeof(a)=%d\n",sizeof(a)); //输出int类型数组a中每个元素的地址、值 for 阅读全文
posted @ 2024-05-19 22:54 王思涵 阅读(12) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #include<time.h> #include<windows.h> #define N 80 void print_text(int line,int col,char text[]); void print_space 阅读全文
posted @ 2024-04-27 22:50 王思涵 阅读(18) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 5 int main(){ int number; int i; srand(time(0)); for(i=0;i<N;++i){ number=rand()%65+1; 阅读全文
posted @ 2024-04-14 22:24 王思涵 阅读(7) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> int main() { int year; float s; scanf("%f",&s); year=(int)(s/(60*60*24*365)+0.5); printf("10亿秒约等于%d年\n",year); sy 阅读全文
posted @ 2024-03-17 14:57 王思涵 阅读(18) 评论(0) 推荐(0)