Untitled
unknown
plain_text
3 years ago
1.3 kB
0
Indexable
Never
#include <stdio.h> #include <string.h> #include <ctype.h> char input[174]; int N[25]; int O[25]; char godie[8]={'.','"',':'}; int helll(int n, int s); int main(void){ int n,s,T=10; while(gets(input)!=NULL){ n=(input[1]-'0'); //printf("%c",input[1]); //printf("%d",n); s=strlen(input); for(int i=5;i<s;i++){ if(input[i]=='w' && (input[i+1]=='0' || input[i+1]=='o') && (input[i+2]=='0' || input[i+2]=='o')){ if((input[i+3]=='c' && input[i+4]=='l') || input[i+3]=='d'){ N[n]++; i=helll(i+3,s)-1; } } else if(input[i]=='v' && input[i+1]=='v' && (input[i+2]=='0' || input[i+2]=='o') && (input[i+3]=='0' || input[i+3]=='o')){ if((input[i+4]=='c' && input[i+5]=='l') || input[i+4]=='d'){ N[n]++; i=helll(i+4,s)-1; } } else if(input[i]=='.'){ O[n]++; } } } for(int i=0;i<10;i++){ printf("%d %d\n",N[i],O[i]); } return 0; } int helll(int n, int s){ for(int i=n;i<s;i++){ if(input[i]=='.'){ return i; } } }