User 施智翔

Member for: 6 years (since Sep 27, 2018)
Type: Registered user
Student for 2018-1 CSIEB0030-Introduction to Computer Programming (I)
Student for 2018-2 CSIEB0040-Introduction to Computer Programming (II)
Student for 2020-1 股票投資分析與程式設計
Full name:
Location:
Website:
About:

Activity by 施智翔

Score: -84 points (ranked #4,109)
Questions: 0
Answers: 92
Comments: 2
Voted on: 0 questions, 0 answers
Gave out: 0 up votes, 0 down votes
Received: 0 up votes, 0 down votes

Wall for 施智翔

#include <stdio.h>
#include<stdlib.h>
#include<string.h>

main() {

    FILE *fp;
    char buff[255],score[60];
    int grade=0;
    float x=0;
    fp = fopen("grade.txt", "r");
    printf("Sorting by average:\n");
    while (!feof (fp)){
        fscanf(fp, "%s", buff);
        printf("%s", buff );
        int i;
        for (i=1;i<=3;i++){
            fscanf(fp, "%d", &grade);
            printf(" %d",grade);
            x=x+grade;
        }
        x=x/3;
        printf(" %.1f",x);
        fscanf(x,"%s",score);
        x=0;
        printf("\n");
    }
    fclose(fp);

}

Feb 21, 2019 by 施智翔
12,783 questions
183,443 answers
172,219 comments
4,824 users