【Codeforces Round #447 (Div. 2) A】QAQ

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】

C语言程序练习题

【代码】

#include <bits/stdc++.h>
using namespace std;

string s;

int main(){
	#ifdef LOCAL_DEFINE
	    freopen("F:\\c++source\\rush_in.txt", "r", stdin);
	#endif
	ios::sync_with_stdio(0),cin.tie(0);
	cin >> s;
	int n = s.size();
	int num = 0;
	for (int i = 0;i < n;i++)
		for (int j = i+1;j < n;j++)
			for (int k = j+1;k < n;k++)
				if (s[i]=='Q' && s[j]=='A' && s[k]=='Q'){
				    num++;
				}
	cout << num << endl;					
	return 0;
}
posted @ 2017-11-20 16:52  AWCXV  阅读(164)  评论(0编辑  收藏  举报