- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- { int n;
- cout<<"please input the number"<<endl;
- cin>>n;
- while (n--)
- {
- int m = 0, t = 0, i = 0;
- string s;
- cout<<"please input the string"<<endl;
- cin>>s;
- while (i <= s.length() - 1)
- {
- if (s[i] == 'X') m = 0;
- else
- {
- m++;
- t += m;
- }
- i++;
- }
- cout<<t<<endl;
- }
- return 0;
- }
算法竞赛入门经典3.1 得分UVa1585
最新推荐文章于 2020-04-13 18:12:58 发布