Submission #207727

#TimeUsernameProblemLanguageResultExecution timeMemory
207727DodgeBallManBridž (COCI17_bridz)C++14
50 / 50
7 ms380 KiB
#include <bits/stdc++.h>

using namespace std;

int ans, n;
char s[20];

int cal( char a ) {
    if( a == 'A' ) return 4;
    else if( a == 'K' ) return 3;
    else if( a == 'Q' ) return 2;
    else if( a == 'J' ) return 1;
    return 0;
}

int main() 
{
    scanf("%d",&n);
    for( int i = 1 ; i <= n ; i++ ) {
        scanf("%s",s);
        for( int j = 0 ; j < 13 ; j++ ) ans += cal( s[j] );
    }
    printf("%d",ans);
}

Compilation message (stderr)

bridz.cpp: In function 'int main()':
bridz.cpp:18:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
bridz.cpp:20:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",s);
         ~~~~~^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...