直接看下面代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int main(){
FILE *fp;
FILE *fpw = fopen("output.txt", "w");
if ((fp = fopen("input.txt", "r")) == NULL)
exit(1);
int n, k;
int i = -1;
while(!feof(fp)){ // 这个视情况而定
if (i == -1)
fscanf(fp, "%d %d", &n, &k);
else{
fscanf(fp, "%d", &a[i]);
b[i] = a[i];
}
i++;
}

fprintf(fpw, "%d\n", minn);

return 0;
}
1
恰似你一低头的温柔,娇弱水莲花不胜寒风的娇羞, 我的心为你悸动不休。  --mingfuyan