#include <iostream>
int main(void) {
int total = 0;
int input = 0;
for (int i = 0; i < 5; i++) {
std::cout << i+1<<"번째 정수 입력: ";
std::cin >> input;
total = total + input;
}
std::cout << "합계" << total << std::endl;
return 0;
}
'언어 > C++' 카테고리의 다른 글
[C++] 시간 줄이기 (0) | 2024.07.02 |
---|---|
[C++] 최대 최소값 구하기 (주의점) (0) | 2024.07.01 |
[C++] precision 절대오차, 상대오차 (0) | 2024.07.01 |
[C++] printf (string 사용) 주의 (0) | 2024.07.01 |
[C++] 오버로딩 (0) | 2024.03.12 |