自考“高級(jí)語(yǔ)言程序設(shè)計(jì)”習(xí)題答案詳解(52)

字號(hào):

8.3 程序分析題
    1.讀程序,寫(xiě)功能。
    # include
    # include
    main()
    { FILE *f1,* f2;
    int k;
    if(( f1= fopen(“c:\\tc \\ pl.c”,“r” )== NULL)
    { printf(“Can not open file! \n”);
    exit(0);
    }
    if((f2= fopen(“a:\\ pl.c”,“w” ))== NULL)
    { printf(“Can not open file! \n” );
    exit(0) ;
    }
    for( k=1;k<=l000;k++)
    { if( feof(f1)) break;
    fputc( fgetc(f1),