摘要: #include<stdio.h> int main() { int c=0; char ch; FILE* fp; fp = fopen("data4.txt", "r"); if (fp == NULL) { printf("无法打开文件\n"); return 1; } ch = fgetc( 阅读全文
posted @ 2022-12-27 17:15 狄一鑫 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 实验任务3 #include <stdio.h> #include<string.h> #include<stdlib.h> #define N 100 typedef struct { char num[10]; // 学号 int s1; // 期末成绩 int s2; // 平时成绩 doub 阅读全文
posted @ 2022-12-21 12:27 狄一鑫 阅读(3) 评论(0) 推荐(0) 编辑
摘要: task1_1.c #include <stdio.h> #define N 4 int main() { int a[N] = { 1, 9, 8, 4 }; char b[N] = { '1', '9', '8', '4' }; int i; printf("sizeof(int) = %d\n 阅读全文
posted @ 2022-11-23 20:51 狄一鑫 阅读(3) 评论(0) 推荐(0) 编辑
摘要: task1.c #include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #define N 80 void print_text(int line, int col, char text[]); vo 阅读全文
posted @ 2022-11-05 11:04 狄一鑫 阅读(21) 评论(0) 推荐(0) 编辑
摘要: task_1 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int number; int i; srand( time(0) ); // 以当前系统时间作为随机种子 for(i = 阅读全文
posted @ 2022-10-20 22:31 狄一鑫 阅读(25) 评论(0) 推荐(0) 编辑