~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;
}