| 比赛 | 20120619 | 评测结果 | AAAAAAAAAA | 
|---|---|---|---|
| 题目名称 | FBI序列 | 最终得分 | 100 | 
| 用户昵称 | Cloud | 运行时间 | 0.000 s | 
| 代码语言 | C++ | 内存使用 | 0.00 MiB | 
| 提交时间 | 2012-06-19 19:38:45 | ||
#include<fstream>
#include<cstring>
using namespace std;
int main(void)
{
	ifstream fin("fbi.in");
	ofstream fout("fbi.out");
	int n,m=0;
	string st;
	fin>>st;
	n=st.length();
	int f=0,b=0,i=0;
	for(int j=0;j<n;j++)
	{
		if(st[j]=='F')
			f++;
		if(st[j]=='B')
			b+=f;
		if(st[j]=='I')
			m+=b;
	}
	fout<<m;
	fin.close();
	fout.close();
	return 0;
}