2006///if-else/ ¶
1
if else 2
~cpp #include<iostream.h> int main(void) { int i, j; cout<<" ."; cin >> i; if(i >= 50 && i <= 100){ cout<< i <<"까 3"; for(j = 1; j <= i; j++){ if(j % 3 == 0){ cout<< j << " "; } } cout <<"\n"; cout<< i <<"까 5"; for(j = 1; j <= i; j++){ if(j % 5 == 0){ cout<< j <<" "; } } } else{ cout <<" 과."; } return 0; }
~cpp #include <iostream.h> void main(void) { char i; cout <<"."; cin >> i; if(i >= 65 && i <= 90){ cout <<"";} else if(i>=97 && i<=122){ cout <<"";} else if(i>=48 && i <=57){ cout <<"";} else{ cout <<""; } }