#include <ctype.h>
#include <stdio.h>
#include <string.h>
int main() {
static char cc[1024];
int n, k;
scanf("%d", &n);
k = 0;
while (scanf("%s", cc) != EOF) {
int end, name, i;
n = strlen(cc);
end = 0;
if (cc[n - 1] == '.' || cc[n - 1] == '?' || cc[n - 1] == '!')
n--, end = 1;
name = 1;
for (i = 0; i < n; i++)
if (!(i == 0 ? isupper(cc[i]) : islower(cc[i]))) {
name = 0;
break;
}
if (name)
k++;
if (end)
printf("%d\n", k), k = 0;
}
return 0;
}
Compilation message
imena.c: In function 'main':
imena.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
9 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
272 KB |
Output is correct |