标签:uva class str for std ++ style pre span
#include<stdio.h> #include<string.h> int main(){ int n; char s[100]; scanf("%d",&n); for(int j=0;j<n;j++){ scanf("%s",s); int count =0; int q=0; int p=0; int len=strlen(s); for(int i=0;i<len;i++){ if(s[i] == ‘O‘ ){ q++; count += q; } else if(s[i] == ‘X‘) q=0; } printf("%d\n",count); } }
标签:uva class str for std ++ style pre span
原文地址:http://www.cnblogs.com/betterluo/p/6217246.html