#include <stdio.h>
int main()
{
    FILE *ifp, *ofp;
    int id;
    int score[4];

    ifp = fopen("/home/jung/test.txt", "r");
    ofp = fopen("/home/jung/res.txt", "w");

    fprintf(ofp, "IDttUNIX CLanguage Network  sum averagen");
    fprintf(ofp, "----------------------------------------------------------n");

    while((fscanf(ifp, "%d%d%d%d", &id, &score[0], &score[1], & score[2])) != EOF)

{
      fprintf(ofp, "t%dtt%dtt%dtt%dtt%lft", id, score[0], score[1], score[2], (score[0]+score[1]+score[2]), (score[0]+score[1]+score[2])/(double)3);
        fprintf(ofp, "n");
    }

    fclose(ifp);
    fclose(ofp);


    return 0;
}



고수준언어인데

read write open 써서 저수준으로 바꿔주세요


test.txt

20140001 99 69 79

20140002 96 79 60

형식이고요

아이디 점수 점수 점수 합계 평균

형식으로 나타내면됩니다 ㅠㅠㅠ

고수님 ㅠㅠㅠㅠㅠㅠㅠㅠ