답안 #165589

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
165589 2019-11-27T14:08:25 Z itiam Bridž (COCI17_bridz) C++11
50 / 50
8 ms 508 KB
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main(){
    int N,uk=0;
    string A;
    char x;
    cin >> N;
    for (int i=0;i<N;i++){
        cin >> A;
        for (int j=0;j<A.length();j++){
            x=A[j];
            if (x!='X'){
                //cout << "haj\n";
                if (x=='J')     uk+=1;
                else if (x=='Q')     uk+=2;
                else if (x=='K')     uk+=3;
                else if (x=='A')     uk+=4;
            }
        }
    }
    cout << uk;
    return 0;
}

Compilation message

bridz.cpp: In function 'int main()':
bridz.cpp:14:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0;j<A.length();j++){
                      ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 3 ms 384 KB Output is correct
7 Correct 3 ms 376 KB Output is correct
8 Correct 4 ms 376 KB Output is correct
9 Correct 6 ms 376 KB Output is correct
10 Correct 8 ms 508 KB Output is correct