Codeup.kr/C언어 기초 100제

[Code up 문제] 1072번 정수 입력받아 계속 출력하기

Jongung 2021. 9. 9. 16:59

 

문제 설명

 

 

1. 정답 코드

#include <stdio.h>

int main(void) {
    int n, m;
  scanf("%d", &n);
  reget: 
  scanf("%d", &m);
  if(n-- != 0) {
     printf("%d\n", m);
    goto reget; 
  }
}

 

2. 코드 설명

레이블 goto 반복문을 사용한 문제이다.