답안 #201572

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
201572 2020-02-11T06:54:48 Z SamAnd Imena (COCI16_imena) C++17
50 / 50
5 ms 376 KB
#include <bits/stdc++.h>
using namespace std;

int nn;

int main()
{
    cin >> nn;
    int q = 0;
    int ans = 0;
    while (1)
    {
        int n;
        string a;
        cin >> a;
        n = a.size();
        bool z = true;
        if (!('A' <= a[0] && a[0] <= 'Z'))
            z = false;
        for (int i = 1; i < n; ++i)
        {
            if (a[n - 1] == '.' || a[n - 1] == '?' || a[n - 1] == '!')
                continue;
            if (!('a' <= a[i] && a[i] <= 'z'))
                z = false;
        }
        if (z)
            ++ans;
        if (a[n - 1] == '.' || a[n - 1] == '?' || a[n - 1] == '!')
        {
            cout << ans << endl;
            ++q;
            ans = 0;
            if (q == nn)
                break;
        }
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 5 ms 376 KB Output is correct