Score, ACM/ICPC Seoul 2005, UVa1585
程序员文章站
2022-03-13 19:28:53
...
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
cin >> t;
while (t-- > 0)
{
string s;
cin >> s;
int sum = 0, consecutive = 0;
int len = s.length();
for (int i = 0; i < len; ++i)
{
if (s[i] == 'X')
{
consecutive = 0;
}
else if (s[i] == 'O')
{
++consecutive;
sum += consecutive;
}
}
cout << sum << endl;
}
}
上一篇: premiere视频怎么添加进度条? pr漫画添加进度条的技巧
下一篇: uva 401(回文词)
推荐阅读
-
分子量 (Molar Mass,ACM/ICPC Seoul 2005,UVa1586)
-
Molar Mass, ACM/ICPC Seoul 2007,UVa1586
-
DNA序列(DNA Consensus String, ACM/ICPC Seoul 2006, UVa1368
-
[Molar Mass, ACM/ICPC Seoul 2007, UVA1586]
-
[Digit Generator, ACM/ICPC Seoul 2005, UVA1583]
-
例题3-6 环状序列(CircularSequence, ACM/ICPC Seoul 2004, UVa1584)
-
Molar Mass, ACM/ICPC Seoul 2007, UVa 1586
-
Tour(旅行)(UVa1347,ACM/ICPC SEERC 2005)(Dp优化去重)
-
例题 7-7 天平难题(Mobile Computing,ACM/ICPC Tokyo 2005,UVa1354)
-
分子量 (Molar Mass,ACM/ICPC Seoul 2005,UVa1586)