U E D R , A S I H C RSS

데블스캠프2006/월요일/연습문제/if-else/임다찬

데블스캠프2006/월요일/연습문제/if-else/임다찬

1번째문제
~cpp
#include <iostream>
using namespace std;
void main(){
	int number;
	
	cin >> number;
	
	if(number >= 50 && number <= 100){
		cout << "3의배수" << endl;
		for(int i = 1; i < number; i++){
			if(i%3==0){
				cout<<" "<<i;
			}
		}
		cout << endl;
		cout << "5d의배수"<<endl;
		for(i=1;i<number;i++){
			if(i%5==0){
				cout<<" "<<i;
			}
		}
		cout<<endl;

			
	}
	else{
		cout << "error" << endl;
	}
	
}
2
~cpp
#include <iostream>
using namespace std;
void main(){
	char mun;
	
	cin >> mun;

	if(mun >= 65 && mun <= 90 || mun>=97 && mun <= 122){
		cout << "영문자" << endl;
	}
	else if(mun >= 48 && mun <= 57){
		cout << "숫자" << endl;
	}
	else{
		cout << "특수문자" << endl;
	}
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:03
Processing time 0.0161 sec