Submission #61650

#TimeUsernameProblemLanguageResultExecution timeMemory
61650win11905Bridž (COCI17_bridz)C++11
50 / 50
5 ms968 KiB
#include <bits/stdc++.h> using namespace std; int sum = 0; char inp[105], A[] = "XJQKA"; int c[256]; int main() { for(int i = 0; i < 5; ++i) c[A[i]] = i; int T; scanf("%d", &T); while(T--) { scanf("%s", inp); for(int i = 0; i < 13; ++i) sum += c[inp[i]]; } printf("%d\n", sum); }

Compilation message (stderr)

bridz.cpp: In function 'int main()':
bridz.cpp:9:38: warning: array subscript has type 'char' [-Wchar-subscripts]
     for(int i = 0; i < 5; ++i) c[A[i]] = i;
                                      ^
bridz.cpp:13:52: warning: array subscript has type 'char' [-Wchar-subscripts]
         for(int i = 0; i < 13; ++i) sum += c[inp[i]];
                                                    ^
bridz.cpp:10:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int T; scanf("%d", &T);
            ~~~~~^~~~~~~~~~
bridz.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s", inp);
         ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...