#include<cstdio> int main(){ int n; int fail = 0; char c; scanf("%d", &n); for (int i=0; i < 10; i++){ int fail_t = 0; for (int j=0; j < n/10; j++){ scanf(" %c", &c); if(c=='N'){ fail_t = 1; } } fail += fail_t; } printf("%d", 10 - fail); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include<cstdio> int main(){ int n; int fail = 0; char c; scanf("%d", &n); for (int i=0; i < 10; i++){ int fail_t = 0; for (int j=0; j < n/10; j++){ scanf(" %c", &c); if(c=='N'){ fail_t = 1; } } fail += fail_t; } printf("%d", 10 - fail); return 0; } |