Submission #370978

# Submission time Handle Problem Language Result Execution time Memory
370978 2021-02-25T10:25:30 Z maozkurt Imena (COCI16_imena) C++17
30 / 50
1 ms 364 KB
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <numeric>
#include <cassert>

#define endl '\n'
#define sp ' '

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

bool isp(char c){
    if(c == '.' || c == '!' || c == '?')
        return true;
    return false;
}

int main(){

    ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);cerr.tie(nullptr);

    int n;cin>>n;
    string s;
    for(int i=0;i<n;i++){
        int cur = 0;
        while(true){
            cin >> s;
            if(isupper(s[0])){
                bool valid = true;
                for(int j = 1;j<(int)s.size()-2;j++){
                    if(!islower(s[j])){
                        valid = false;
                        break;
                    }
                }
                if(!isp(s[s.size()-1]) && !islower(s[s.size()-1]))
                    valid = false;
                if(valid)
                    cur++;
            }
            if(isp(s[s.size()-1]))
                break;
        }
        cout << cur << endl;
    }

}











# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 1 ms 364 KB Output isn't correct
6 Incorrect 1 ms 364 KB Output isn't correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Incorrect 1 ms 364 KB Output isn't correct
10 Correct 0 ms 364 KB Output is correct