문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWBnA2jaxDsDFAWr


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        int score, total=0;
        for(int i=0; i<5; i++) {
            cin >> score;
            if(score < 40)
                score = 40;
            total += score;
        }
 
        cout << "#" << t_case+1 << " " << total/5 << "\n";
    }
 
    return 0;
}
cs

문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWD3Y27q3QIDFAUZ


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    long int T, Pn[100];
    cin >> T;
 
    Pn[0= 1;
    Pn[1= 1;
    Pn[2= 1;
    Pn[3= 2;
    Pn[4= 2;
 
    for(int i=5; i<100; i++) {
        Pn[i] = Pn[i-1+ Pn[i-5];
    }
 
    for(int t_case=0; t_case<T; t_case++) {
        int N;
        cin >> N;
 
        cout << "#" << t_case+1 << " " << Pn[N-1<< "\n";
    }
 
    return 0;
}
cs

문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV19AcoKI9sCFAZN


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        int cnt = 0;
        char now = '0';
        string memory;
 
        cin >> memory;
 
        for(int i=0; i<memory.length(); i++) {
            if(memory.at(i) != now) {
                if(now == '0')
                    now = '1';
                else
                    now = '0';
                cnt++;
            }
        }
 
        cout << "#" << t_case+1 << " " << cnt << "\n";
    }
}
cs

문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV189xUaI8UCFAZN


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T, P, Q, R, S, W;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        int Aprice, Bprice;
        cin >> P >> Q >> R >> S >> W;
 
        Aprice = W * P;
 
        if(W <= R)
            Bprice = Q;
        else {
            Bprice = Q + (W-R) * S;
        }
 
        cout << "#" << t_case+1 << " " << (Aprice<Bprice ? Aprice : Bprice) << "\n";
    }
 
    return 0;
}
cs


https://dev-repository.tistory.com/62

'C & C++ > SW Expert Academy' 카테고리의 다른 글

SWEA 1289 - 원재의 메모리 복구하기  (0) 2018.04.28
SWEA 1284 - 수도 요금 경쟁  (0) 2018.04.28
SWEA 1288 - 새로운 불면증 치료법  (0) 2018.04.28
SWEA 1928 - Base64 Decoder  (0) 2018.04.28
SWEA 1940 - 가랏! RC카!  (0) 2018.04.28

+ Recent posts