U E D R , A S I H C RSS

데블스캠프2006/월요일/연습문제/if-else/윤성준

데블스캠프2006/월요일/연습문제/if-else/윤성준

1번째문제
~cpp


#include <iostream>

using namespace std;

int main (void)
{

	int i, n;

	
	while (1) {
		
		cout << endl << "50~100 까지 숫자 입력 :";
		
		cin >> i;

		if ( i >= 50 && i <= 100 ) {
			
			cout << "3의배수" <<endl;

			for(n = 0; n <= i; n=3+n) {
				if ( n != 0 )
					cout << n<<" ";
			}
			
			cout << endl;

			cout << "5의 배수" <<endl;

			for(n = 0; n <= i; n=5+n) {
				if ( n != 0 )
					cout << n <<" ";
			}

		}
		else {
			cout << "잘못입력" <<endl;
		}


	}
	
	return 0;

}


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:03
Processing time 0.0132 sec