2022年6月7日

实验六 指针

摘要: task1_1.c #include <stdio.h> #define N 4 int main() { int x[N] = { 1, 9, 8, 4 }; int i; int* p; // 方式1:通过数组名和下标遍历输出数组元素 for (i = 0; i < N; ++i) printf 阅读全文

posted @ 2022-06-07 17:25 孙羽彤 阅读(32) 评论(2) 推荐(0) 编辑

2022年6月1日

实验五 结构体和文件

摘要: task1_1.c 把程序中的数据,写入文本文件data1.txt中。 // 将图书信息写入文本文件data1.txt #include <stdio.h> #define N 5 #define M 80 typedef struct { char name[M]; // 书名 char auth 阅读全文

posted @ 2022-06-01 20:47 孙羽彤 阅读(35) 评论(1) 推荐(0) 编辑

2022年5月3日

实验4 数组

摘要: 1. 实验任务1 task1_1.c ① int型数组a,在内存中是连续存放的,每个元素占用四个内存字节单元 ② char型数组b,在内存中是连续存放的,每个元素占用一个内存字节单元 ③数组名a对应的值,和&a[0]是一样的,数组名b对应的值,和&b[0]是一样的 #include <stdio.h 阅读全文

posted @ 2022-05-03 19:17 孙羽彤 阅读(9) 评论(1) 推荐(0) 编辑

2022年4月19日

实验3 函数

摘要: 1. 实验任务1 task1.c 程序功能:在屏幕上 25行,80列 的范围内任意位置打印十次字符串”hi,May~“,每次打印间隔1000ms #include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> 阅读全文

posted @ 2022-04-19 19:49 孙羽彤 阅读(12) 评论(1) 推荐(0) 编辑

2022年4月12日

实验2 C语言控制语句应用编程

摘要: 1.实验任务一 task1.c #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int grade, number; int i; srand(time(0));// 以当前系统时间作 阅读全文

posted @ 2022-04-12 19:16 孙羽彤 阅读(102) 评论(1) 推荐(0) 编辑

2022年3月22日

task6.c

摘要: #include <stdio.h> #include<string.h> int main() { int answer; char words[5000]; printf("网课学习让一些人欢喜一些人忧.\n"); printf("1. 作为喜欢自学且自律的人,觉得这样很好. 有网络,自主学习, 阅读全文

posted @ 2022-03-22 20:42 孙羽彤 阅读(9) 评论(1) 推荐(0) 编辑

task5.c

摘要: #include <stdio.h> int main() {char ans1, ans2; printf("第3章认真学完一遍了没? (输入y或Y表示认真学完一遍了,输入n或N表示没有) :"); ans1=getchar(); getchar(); printf("\n动手敲代码实践了没? ( 阅读全文

posted @ 2022-03-22 20:17 孙羽彤 阅读(14) 评论(0) 推荐(0) 编辑

task4.c

摘要: #include <stdio.h> int main() { int age1, age2; char gender1, gender2; scanf("%d%c%d%c", &age1, &gender1, &age2, &gender2); printf("age1 = %d, gender1 阅读全文

posted @ 2022-03-22 19:39 孙羽彤 阅读(25) 评论(0) 推荐(0) 编辑

task3.c

摘要: #include<stdio.h> int main() { double x, y; char c1, c2, c3; int a1, a2, a3; scanf("%d %d %d", &a1, &a2, &a3); printf("%d,%d,%d\n", a1, a2, a3); scanf 阅读全文

posted @ 2022-03-22 19:30 孙羽彤 阅读(12) 评论(0) 推荐(0) 编辑

task2_3.c

摘要: #include <stdio.h> #include <stdlib.h> #include <math.h> int main() { double c, f; while (scanf("%lf",&c) != EOF) { f = c*9 / 5 + 32; printf("摄氏度c=%.2 阅读全文

posted @ 2022-03-22 18:44 孙羽彤 阅读(17) 评论(0) 推荐(0) 编辑

导航