摘要: #include #include int main() { FILE *fin, *fout; // 定义文件类型指针 int ch; fin = fopen("file1.txt", "r"); // 以只读文本方式打开文件file1.txt if (fin == NULL) { printf( 阅读全文
posted @ 2021-06-11 11:40 李晨阳 阅读(32) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行程序输入测试时,可以把N改小一些输入测试 typedef struct student { int id; /*学生学号 */ char name[20] 阅读全文
posted @ 2021-06-09 23:26 李晨阳 阅读(22) 评论(1) 推荐(0)
摘要: #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 = %lld\n", n, 阅读全文
posted @ 2021-04-29 21:09 李晨阳 阅读(34) 评论(1) 推荐(0)
摘要: #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()%100; printf("%3d",x 阅读全文
posted @ 2021-04-15 12:02 李晨阳 阅读(43) 评论(1) 推荐(0)
摘要: #include <iostream> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** arg 阅读全文
posted @ 2021-03-30 16:21 李晨阳 阅读(51) 评论(1) 推荐(0)