第二次编程总结

#include<stdlib.h>
int main(void)
{
    FILE * fp;
    int i,m,n;
    int a[5];
    if((fp=fopen("C:\ha\ha.txt","r+"))==NULL){
        printf("File open error! ");
        exit(0);
    }
    for(i=0;i<5;i++)
   
    {  
    fscanf(fp,"%d",&a[i]);
    }
   
    m=a[0];
    for(i=0;i<5;i++) {
        if(m<a[i]) m=a[i]; n=i; } fprintf(fp," %d %d",m,n);
    if(fclose(fp)){
        printf("Can not close the file! ");
        exit(0);
    }
    return 0;

(2)

(3)

原文地址:https://www.cnblogs.com/wsxjydbb/p/10502727.html