摘要: 实验4 #include<stdio.h> int main() { char a; int count=0; FILE *fp; fp = fopen("data4.txt","r"); if(fp==NULL) { printf("fail to open\n"); return 1; } wh 阅读全文
posted @ 2023-12-20 16:16 陈星我儿 阅读(22) 评论(0) 推荐(0)
摘要: 实验4 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double sales_price; // 售价 int 阅读全文
posted @ 2023-12-11 17:20 陈星我儿 阅读(33) 评论(0) 推荐(0)
摘要: 实验1 功能是分别找到输入数中的最小值和最大值 两者都指向x[0] 功能是找到最大数,返回的是最大数的地址 可以,因为改变之后返回的也是最大值的地址 实验2 s1大小是24个字节,sizeof以字节为单位返回一个变量,表达式或类型的长度, strlen是计算字符串长度的,不包含结尾符号‘\0’ 不能 阅读全文
posted @ 2023-12-03 21:56 陈星我儿 阅读(29) 评论(0) 推荐(0)
摘要: 实验1 int型一维数组连续存放,占四个字节,一样的 char型一维数组连续存放,占一个字节,一样的 int型二维数组连续存放,占四个字节,一样的 char型二维数组,连续存放,占一个字节,一样的 相差16个字节 相差4个字节 相差的都是第一行元素所占内存 实验二 text1中是一维数组,text2 阅读全文
posted @ 2023-11-13 22:42 陈星我儿 阅读(35) 评论(0) 推荐(0)
摘要: 实验1 每隔100ms在随机显示字符串 实验2 一致 实验3 实验4 实验5 实验六 实验七 #include<stdio.h> int func(int n2,int n3); int main() { int n=0; int flag=0; while(1){ int n2,n3; n2=n* 阅读全文
posted @ 2023-10-30 21:13 陈星我儿 阅读(25) 评论(0) 推荐(0)
摘要: 实验1 #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 5 #define N1 374 #define N2 465 int main() { int number; int i; srand(time(0)); fo 阅读全文
posted @ 2023-10-16 20:47 陈星我儿 阅读(29) 评论(0) 推荐(0)
摘要: 实验一 代码1 结果1 代码2 结果2 实验二 代码 结果 实验三 代码 结果 实验四 代码 结果 实验五 代码 #include<stdio.h> int main() { int year; double s; s=1000000000; year=s/60/60/24/365+0.5; pri 阅读全文
posted @ 2023-10-06 16:22 陈星我儿 阅读(23) 评论(0) 推荐(0)