hyunjin

[C++][반복실행구조]1071, goto 본문

알고리즘 연습/코드업

[C++][반복실행구조]1071, goto

_h.j 2020. 9. 4. 14:28
728x90

[1071] goto를 사용해서 풀기

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a;
	reload:
	cin >> a;
	if(a != 0){
		cout<<a<<"\n";
		goto reload;
	}
	return 0;
}

 

 

 

 

728x90