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


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



#include <iostream>
#include <string>
 
using namespace std;
 
int main(void) {
    int T;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        bool answer = true;
        string str;
 
        cin >> str;
 
        for(int i=0; i<str.length()/2; i++) {
            if(str.at(i) != str.at(str.length()-i-1)) {
                answer = false;
                break;
            }
        }
 
        cout << "#" << t_case+1 << " " << answer << "\n";
    }
 
    return 0;
}
cs

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


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



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T, N;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        cin >> N;
 
        if(N%2 == 1) {
            cout << "#" << t_case+1 << " " << N/2+1 << "\n";
        } else {
            cout << "#" << t_case+1 << " " << -(N/2<< "\n";
        }
 
        
    }
 
    return 0;
}
cs

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


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



#include <iostream>
 
using namespace std;
 
int main(void) {
    string grade[10= {"A+""A0""A-""B+""B0""B-""C+""C0""C-""D0"};
    int T, N, K;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        cin >> N >> K;
        float score[N], temp;
 
        for(int i=0; i<N; i++) {
            score[i] = 0;
            cin >> temp;
            score[i] += temp * 0.35;
            cin >> temp;
            score[i] += temp * 0.45;
            cin >> temp;
            score[i] += temp * 0.20;
        }
 
        int cnt = 0;
 
        for(int i=0; i<N; i++) {
            if((score[i] > score[K-1]) & (i != K-1)) {
                cnt++;
            }
        }
 
        cout << "#" << t_case+1 << " " << grade[(cnt)/(N/10)] << "\n";
    }
 
    return 0;
}
cs


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

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


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



#include <iostream>
 
using namespace std;
 
int main(void) {
 
    for(int t_case=0; t_case<10; t_case++) {
        int score[101= {0}, temp, max=0, max_students=0;
 
        cin >> temp;
        
        for(int i=0; i<1000; i++) {
            cin >> temp;
            score[temp]++;
        }
 
        for(int i=0; i<101; i++) {
            if(score[i] >= max_students) {
                max = i;
                max_students = score[i];
            }
        }
 
        cout << "#" << t_case+1 << " " << max << "\n";
    }
 
    return 0;
}
cs

+ Recent posts