Score UVA - 1585
2017-04-03 12:46
537 查看
问题类型:字符串,计数。
03pie’s solution for [UVA-1585]:
03pie’s solution for [UVA-1585]:
#include<cstdio> #include<iostream> #include<sstream> #include<cstdlib> #include<cmath> #include<cctype> #include<string> #include<cstring> #include<algorithm> #include<stack> #include<queue> #include<set> #include<map> #include<ctime> #include<vector> #include<fstream> #include<list> using namespace std; #define ms(s) memset(s,0,sizeof(s))typedef unsigned long long ULL; typedef long long LL; const double PI = 3.141592653589; const int INF = 0x3fffffff; #define maxn 90 int main(){ // freopen("F://inp.txt","r",stdin); char s[maxn]; int T=0; scanf("%d",&T); while(T--) { scanf("%s",s); int len=strlen(s); int p=1,temp=0,score=0; for(int i=0;i<len;i++) { if(s[i]=='X'){ p=0; } if(s[i]=='O'){ p=1; } if(p){ temp++; } else temp=0; score+=temp; } printf("%d\n",score); } return 0; }
相关文章推荐
- UVa-1585 Score
- UVA 1585 - Score
- UVa1585 Score
- UVa 1585 Score
- uva 1585 Score(水题)
- UVa 1585 Score
- Score UVA - 1585
- UVA-1585 Score
- 小紫书 习题 3-1(UVA 1585) 得分(Score)
- 得分(Score,ACM/ICPC Seoul 2005,UVa1585)
- uva 1585 - Score
- UVa 1585 Score
- 算法竞赛入门经典习题3-1 得分(Score,ACM/ICPC Seoul2005,UVa1585)
- UVa 1585 - Score
- UVa 1585 - Score
- chaper3_exercise_Uva1585_score
- UVA-1585 Score
- UVA1585 得分score
- UVa 1585 - Score
- UVa1585——Score