资讯动态

代码题练习

发布时间:2026/10/3 5:41:03 来源:尧图企业网站定制
1.#includestdio.hint main(){int arr []{ 73,32, 99, 97, 110, 32, 111, 105, 116, 33 };int i 0;int sz sizeof(arr) / sizeof(arr[0]);//整个数组占用的总字节数除以数组单个元素//占用四个字节得到数组元素总个数while (i sz){printf(“%c”, arr[i]);//%c专门用来把ASCII码值转为字符输出i;}return 0;}#includestdio.hint main(){int year 0;int month 0;int date 0;scanf(“%4d %2d %2d”, year, month, date);//数字表示读取几个字符printf(“year%4d\n”, year);printf(“month%02d\n”, month);printf(“date%02d\n”, date);return 0;}

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑