Codeup.kr/C언어 기초 100제
[Code up 문제] 1073번 0 입력될 때까지 무한 출력하기2
Jongung
2021. 9. 9. 17:04
1. 정답 코드
#include <stdio.h>
int main(void) {
int i = 1;
while(i != 0){
scanf("%d", &i);
if(i!=0)
printf("%d\n", i);
}
}
2. 코드 설명
while문과 if문을 같이 쓴 문제이다. 0을 제외한 숫자를 입력하면 출력 시키는 문제이다.