# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
864343 | ElenaBM | Imena (COCI16_imena) | C++17 | 0 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>> n;
int frase = 0;
while (frase < n){
string s;
getline (cin, s);
s.push_back(' ');
int cont = 0;
bool name = false;
if (s[0] > 64 && s[0] < 91){
name = true;
cont += 1;
}
for (int i = 1; i < (int)s.size()-1; i++){
if (s[i] < 91){
if (s[i] > 64 && !name){ //mayusculas y principio nombre
name = true;
cont += 1;
}
else if (s[i] < 65){ //signos puntuacion o numeros
if (name == true && s[i] > 47 && s[i] < 58){ //no es nombre
cont--;
name = false;
}
else if (s[i] == 33 or s[i] == 46 or s[i] == 63){
frase++;
cout<< cont << '\n';
name = false;
cont = 0;
}
else{
name = false;
}
}
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |