摘要: #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("%d", x[i]); pri 阅读全文
posted @ 2022-06-13 21:39 施乐乐 阅读(17) 评论(3) 推荐(0) 编辑
摘要: #include<stdio.h> #define N 5 #define M 80 typedef struct { char name[M]; char author[M]; } Book; int main() { Book x[N]={{"一九八四","乔治·奥威尔"}, {"美丽新世界", 阅读全文
posted @ 2022-06-05 21:02 施乐乐 阅读(22) 评论(3) 推荐(0) 编辑
摘要: #include<stdio.h> #define N 4 int main() { int a[N]={2,0,2,2}; char b[N]={'2','0','2','2'}; int i; printf("sizeof(int)=%d\n",sizeof(int)); printf("siz 阅读全文
posted @ 2022-05-08 13:10 施乐乐 阅读(9) 评论(3) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<time.h> #include<windows.h> #define N 80 void printText(int line,int col,char text[]); void printSpaces( 阅读全文
posted @ 2022-04-24 15:10 施乐乐 阅读(17) 评论(3) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 3 int main() { int i,n,k; srand(time(0)); printf("猜猜2022年4月哪一天会是你的lucky day\n"); k=ran 阅读全文
posted @ 2022-04-17 17:14 施乐乐 阅读(15) 评论(3) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { int answer; char words[5000]; printf("网课学习让一些人欢喜一些人忧.\n"); printf("1.作为喜欢自学且自律的人,觉得这样很好,有网络,自主学习,很ok.\n"); printf("2.不喜 阅读全文
posted @ 2022-03-25 23:04 施乐乐 阅读(8) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { char ans1,ans2; printf("第3章认真学完一遍了没?(输入y或Y表示认真学完一遍了,输入n或N表示没有):"); ans1=getchar(); getchar(); printf("\n动手敲代码实践了没?(输入y或 阅读全文
posted @ 2022-03-25 23:01 施乐乐 阅读(14) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { int age1,age2; char gender1,gender2; scanf("%d%c%d%c",&age1,&gender1,&age2,&gender2); printf("age1=%d,gender1=%c\n",age 阅读全文
posted @ 2022-03-25 22:58 施乐乐 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #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); getchar();//读 阅读全文
posted @ 2022-03-25 22:54 施乐乐 阅读(5) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<math.h> int main() { double x,ans; scanf("%lf",&x); ans=pow(x,365); printf("%.2f的365次方:%.2f\n",x,ans); r 阅读全文
posted @ 2022-03-25 22:51 施乐乐 阅读(9) 评论(0) 推荐(0) 编辑