摘要: 实验三 实验四 // 从文本数据文件file1.dat中读入数据,按成绩从高到低排序,将排序结果输出到屏幕上,同时以文本方式存入文件file3.dat中。 #include <stdio.h> #include <stdlib.h> #define N 10 // 定义一个结构体类型STU type 阅读全文
posted @ 2021-06-17 20:38 懒得动诶 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 实验6 // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行 阅读全文
posted @ 2021-06-10 22:47 懒得动诶 阅读(105) 评论(1) 推荐(0) 编辑
摘要: 实验1 #include <stdio.h> const int N=3; int main() { int a[N] ; a[N] = {1,2,3}; int i; printf("通过数组名和下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\ 阅读全文
posted @ 2021-05-27 22:48 懒得动诶 阅读(88) 评论(1) 推荐(0) 编辑
摘要: text 1 #include<stdio.h> long long fun(int n); int main() { int n; long long f; while(scanf("%d", &n) != EOF) { f = fun(n); // 函数调用 printf("n = %d, f 阅读全文
posted @ 2021-04-29 22:11 懒得动诶 阅读(151) 评论(0) 推荐(0) 编辑
摘要: task1 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main(){ int x, n; srand(time(0)); for(n=1 ; n<=N; n++){ x = rand() % 10 阅读全文
posted @ 2021-04-15 19:36 懒得动诶 阅读(43) 评论(2) 推荐(0) 编辑
摘要: #include <stdio.h> #include <math.h> int main(){ int sum, n, num; printf("请输入求和项数:") ; scanf("%d",&num); if(num>=1 && num<=10 ){ int n=1,sum=1; while( 阅读全文
posted @ 2021-03-31 16:47 懒得动诶 阅读(279) 评论(2) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { printf(" o o\n"); printf("<I> <I>\n"); printf("I I I I\n"); return 0; } 阅读全文
posted @ 2021-03-13 14:22 懒得动诶 阅读(103) 评论(0) 推荐(0) 编辑