Submission #88422

# Submission time Handle Problem Language Result Execution time Memory
88422 2018-12-05T20:53:10 Z AntonioDaki Imena (COCI16_imena) C++14
50 / 50
2 ms 760 KB
#include<bits/stdc++.h>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
    int n, n1 = 0, m = 0, m1 = 0, ok = 1;
    string s;
    cin >> n;
    for(int n1 = 0; n1 < n; ++n1){
    ok = 1;
    m = 0;
    while(ok){
        cin >> s;
    	if(s[0] >= 65 and s[0] <= 90) m1 = 1;
    	for(int i = 0; i < 1000; ++i){
				if(s[i] >= 48 and s[i] <= 57) m1 = 0;
                if (s[i] == 0) i = 1001;
    	        if(s[i] == 33 or s[i] == 46 or s[i] == 63) ok = 0;
    	    }
    	if(m1) ++m;
    	m1 = 0;
	}
	cout << m << endl;
    }

	return 0;
}

Compilation message

imena.cpp: In function 'int main()':
imena.cpp:10:12: warning: unused variable 'n1' [-Wunused-variable]
     int n, n1 = 0, m = 0, m1 = 0, ok = 1;
            ^~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 624 KB Output is correct
4 Correct 2 ms 676 KB Output is correct
5 Correct 2 ms 676 KB Output is correct
6 Correct 2 ms 760 KB Output is correct
7 Correct 2 ms 760 KB Output is correct
8 Correct 2 ms 760 KB Output is correct
9 Correct 2 ms 760 KB Output is correct
10 Correct 2 ms 760 KB Output is correct