摘要: 任务4 #include<stdio.h> int main(){ char ch; FILE *fp; fp=fopen("data4.txt","r"); if(fp==NULL){ printf("fail to open file"); return 1; } int count=0; ch 阅读全文
posted @ 2022-12-26 11:53 杭凡 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 实验5 任务3 #include <stdio.h> #include<string.h> #define N 100 typedef struct { char num[10]; // 学号 int s1; // 期末成绩 int s2; // 平时成绩 double sum; // 总评 cha 阅读全文
posted @ 2022-12-26 11:36 杭凡 阅读(15) 评论(0) 推荐(0) 编辑
摘要: #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", sizeof(int)); printf("sizeof(c 阅读全文
posted @ 2022-11-26 22:42 杭凡 阅读(22) 评论(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 阅读全文
posted @ 2022-11-06 15:00 杭凡 阅读(17) 评论(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 < 阅读全文
posted @ 2022-10-21 22:04 杭凡 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 任务一 #include <stdio.h> int main() { printf(" O \n"); printf("<H>\n"); printf("I I\n"); printf(" O \n"); printf("<H>\n"); printf("I I\n"); return 0; } 阅读全文
posted @ 2022-10-12 21:27 杭凡 阅读(23) 评论(0) 推荐(0) 编辑