摘要: 实验任务三 屏幕上有正确输出,生成了file3.dat,打开后数据直观可读。 实验任务四 子任务一: 屏幕上有正确输出,生成了二进制文件file4.dat,打开后数据直观可读。 子任务二: #include <stdio.h> #include <stdlib.h> #include <string 阅读全文
posted @ 2021-06-11 20:41 钟离&尘世闲游 阅读(36) 评论(1) 推荐(0) 编辑
摘要: 实验任务一#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 4 // 运行程序输入测试时,可以把N改小一些输入测试 typedef struct student { int id; /*学生学号 */ char nam 阅读全文
posted @ 2021-06-08 17:48 钟离&尘世闲游 阅读(41) 评论(1) 推荐(0) 编辑
摘要: 实验任务一 #include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名和下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", 阅读全文
posted @ 2021-05-22 16:20 钟离&尘世闲游 阅读(83) 评论(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 = 阅读全文
posted @ 2021-04-27 17:01 钟离&尘世闲游 阅读(62) 评论(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() % 10 阅读全文
posted @ 2021-04-13 19:30 钟离&尘世闲游 阅读(87) 评论(2) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { int num; scanf("%d", &num); printf("2049%04d\n", num); scanf("%d", &num); printf("2049%04d\n", num); scanf("%d", &num) 阅读全文
posted @ 2021-03-27 20:25 钟离&尘世闲游 阅读(63) 评论(2) 推荐(0) 编辑
摘要: #include <stdio.h> int main(){ printf(" 0 0\n" ); printf("<H> <H>\n" ); printf("I I I I\n" ); return 0; } #include <stdio.h> int main(){ int x,y; int 阅读全文
posted @ 2021-03-14 09:53 钟离&尘世闲游 阅读(85) 评论(2) 推荐(0) 编辑