(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-8242763509535969", enable_page_level_ads: true }); 'code' 카테고리의 글 목록 (10 Page) :: 깜냥깜냥
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include<stdio.h>
void main()
{
    char name[3][10];/////////////세 사람 성적 구하기
    int score[3][4];//국,영,수,총
    float avg[3];//평균
 
    for(int i=0;i<3;i++){
        printf("Name input: ");
        scanf("%s",name+i);
 
        for(int j=0;j<3;j++){
            printf("Score input: ");
            scanf("%d",*(score+i)+j);
        }
        *(*(score+i)+3)=**(score+i)+*(*(score+i)+1)+*(*(score+i)+2);
        *(avg+i)=*(*(score+i)+3)/3.f;
    }
 
    for(int i=0;i<3;i++){
        printf("%s\t",name+i);
        for(int j=0;j<4;j++){
            printf("%d\t",*(*(score+i)+j));
        }
        printf("%f\n",*(avg+i));
    }
}



'code > C' 카테고리의 다른 글

[C] 성적처리 모듈화-3반  (0) 2017.04.20
[C] 성적처리 모듈화-3사람  (0) 2017.04.20
[C] 성적처리 모듈화-1사람  (0) 2017.04.20
[C] 성적처리-3반  (0) 2017.04.20
[C]성적관리프로그램 - 한 사람  (0) 2017.04.20

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include<stdio.h>
void main()
{
    char name[10];/////////////한 사람 성적 구하기
    int score[4];//국,영,수,총
    float avg;//평균
 
    printf("Name input: ");
    scanf("%s",name);
 
    printf("Kor Score input: ");
    scanf("%d",score);
    printf("Eng Score input: ");
    scanf("%d",score+1);
    printf("Mat Score input: ");
    scanf("%d",score+2);
 
    
    *(score+3)=*score+*(score+1)+*(score+2);
 
    avg=*(score+3)/3.f;
    
    printf("%s\t%d\t%d\t%d\t%d,\t%f\n",name,*score,*(score+1),*(score+2),*(score+3),avg);
    
 
}


'code > C' 카테고리의 다른 글

[C] 성적처리 모듈화-3반  (0) 2017.04.20
[C] 성적처리 모듈화-3사람  (0) 2017.04.20
[C] 성적처리 모듈화-1사람  (0) 2017.04.20
[C] 성적처리-3반  (0) 2017.04.20
[C] 성적관리프로그램 - 세 사람  (0) 2017.04.20

+ Recent posts