์ƒˆ์†Œ์‹

๐Ÿงฎ PS

์ฝ”๋“œ์—… (Code up) 1065 ~ 1070 (์„ ํƒ์‹คํ–‰๊ตฌ์กฐ) [ C++, CPP ]

  • -

*๋ฌธ์ œ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23

 

๋ฌธ์ œ์ง‘ / ๊ธฐ์ดˆ 100์ œ

 

codeup.kr

 

 

*1065๋ฒˆ

#include <iostream>
using namespace std;
int main(){
    int a, b, c;
    cin >> a >> b >> c;
    if(a%2==0){
        cout << a<<endl;
    }
    if(b%2==0){
        cout << b<<endl;
    }
    if(c%2==0){
        cout << c<<endl;
    }    
}

 

 

 

 

*1066๋ฒˆ

 

#include <iostream>
using namespace std;
int main(){
    int a, b, c;
    cin >> a >> b >> c;
    if(a%2!=0){cout <<"odd"<<endl;}
    else{cout << "even" <<endl;}
    
    if(b%2!=0){cout << "odd"<<endl;}
    else{cout << "even" <<endl;}

    if(c%2!=0){cout << "odd"<<endl;}    
    else{cout << "even" <<endl;}
}

 

 

 

*1067๋ฒˆ

 

#include <iostream>
using namespace std;
int main(){
    long long a;
    cin >> a ;
    if(a>0){cout <<"plus\n";}
    else{cout << "minus\n";}
    if(a%2!=0){cout << "odd"<<endl;}
    else{cout << "even" <<endl;}
}

 

 

 

*1068๋ฒˆ

#include <iostream>
using namespace std;
int main(){
    long long a;
    cin >> a ;
    if(a>=90){cout <<"A";}
    else if(a>=70){cout << "B";}
    else if(a>=40){cout << "C";}
    else{cout << "D";}
}

 

 

 

*1069๋ฒˆ

#include <iostream>
using namespace std;
int main(){
    char a;
    cin >> a;
    switch(a){
        case 'A' : cout<<"best!!!"; break;
        case 'B' : cout<<"good!!"; break;
        case 'C' : cout<<"run!"; break;
        case 'D' : cout<<"slowly~"; break;
        default : cout<<"what?"; break;
    }
}

 

 

*1070๋ฒˆ

 

#include <iostream>
using namespace std;
int main(){
    int a;
    cin >> a;
    switch(a){
        case 12:
        case 1:
        case 2:printf("winter");break;
        case 3:
        case 4:
        case 5:printf("spring");break;
        case 6:
        case 7:
        case 8:printf("summer");break;
        case 9:
        case 10:
        case 11:printf("fall");break;
    }
}

 

 

*ํŒŒ์ด์ฌ ํ’€์ด๋„ code up ์นดํ…Œ๊ณ ๋ฆฌ์— ์žˆ์Šต๋‹ˆ๋‹ค.

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.