摘要: 1 // 将file1.txt中小写字母转换成大写后,另存为file2.txt 2 #include <stdio.h> 3 #include <stdlib.h> 4 5 int main() { 6 FILE *fin, *fout; // 定义文件类型指针 7 int ch; 8 9 fin 阅读全文
posted @ 2021-06-15 16:00 Jackynuist 阅读(31) 评论(1) 推荐(0)
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #define N 3 // 运行程序输入测试时,可以把N改小一些输入测试 5 6 typedef struct student { 7 int id; /*学生学号 */ 阅读全文
posted @ 2021-06-10 12:20 Jackynuist 阅读(57) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 #define N 3 3 int main(){ 4 5 int a[N]={1,2,3};//若用 const int 定义N,报错。 数组不能用可变长度的参数初始化 6 int i; 7 8 9 10 printf("通过数组名和下标直接访问数组元素 阅读全文
posted @ 2021-05-27 23:32 Jackynuist 阅读(44) 评论(0) 推荐(0)
摘要: #include<stdio.h> void fun(int n); int main(){ int n; long long f; while(scanf("%d", &n)!=EOF){ fun(n); } return 0; } void fun(int n){ int f[505],a[50 阅读全文
posted @ 2021-04-29 22:43 Jackynuist 阅读(27) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #define N 5 int main(){ int x,n; srand(time(0));//time 返回一个值,是格林尼治时间1900年1月1日距现在的秒数(可保证不同的数) for(n=1;n<=N;n++){ x 阅读全文
posted @ 2021-04-15 17:21 Jackynuist 阅读(47) 评论(1) 推荐(0)
摘要: 2.1 #include<stdio.h> #define EOF -1 int main() { int num; while(scanf("%d",&num)!=EOF) //不要加; { printf("2049%04d\n",num); //while加{} ,0即用0补齐 } return 阅读全文
posted @ 2021-03-31 22:28 Jackynuist 阅读(55) 评论(2) 推荐(0)
摘要: 一、列小人 #include<stdio.h> int main(){ printf("0000000000\n"); printf("0 0 0 0\n"); printf("0 0 0 \n"); printf("0 00000 0\n"); printf("0000000000 \n"); p 阅读全文
posted @ 2021-03-15 22:29 Jackynuist 阅读(92) 评论(0) 推荐(0)