C/간단한 프로그램

(1)성적표 입출력 문제

태영_ 2018. 6. 18. 14:39

 

 

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
28
29
30
31
32
33
#include <iostream>
 
using namespace std;
 
void main()
{
    int iKor = 0;
    int iMath = 0;
    int iEng = 0;
 
    cout << "성적표 입출력 프로그램" << endl;
    cout << "국어 점수 입력 : ";
    cin >> iKor;
    cout << "수학 점수 입력 : ";
    cin >> iMath;
    cout << "영어 점수 입력 : ";
    cin >> iEng;
 
    float iSum = iKor + iMath + iEng;
    float iAvr = iSum / 3;
 
    system("cls");
 
    cout << "국어점수 : " << iKor << endl;
    cout << "수학점수 : " << iMath << endl;
    cout << "영어점수 : " << iEng << endl;
    cout << "총점 : " << iSum << endl;
    cout << "평균 : " << iAvr << endl;
 
    system("pause");
 
 
}
cs