| 比赛 | 
    20120707 | 
    评测结果 | 
    AWWWWAAWWW | 
    | 题目名称 | 
    表达式游戏 | 
    最终得分 | 
    30 | 
    | 用户昵称 | 
    TBK | 
    运行时间 | 
    0.004 s  | 
    | 代码语言 | 
    C++ | 
    内存使用 | 
    0.31 MiB  | 
    | 提交时间 | 
    2012-07-07 10:25:35 | 
显示代码纯文本
#include <iostream> 
#include <cmath> 
#include <cstring> 
#include <string> 
#include <cstdio> 
#include <cstdlib> 
#include <iomanip> 
#include <set> 
#include <algorithm> 
#define MAXN 0x7fffffff 
using namespace std; 
string str;
int a,s;
bool bo[34];
int main(void) 
{    
    freopen("expression.in","r",stdin); 
    freopen("expression.out","w",stdout); 
	cin>>str;
	for (a=0;a<str.length();a++)
		if ((str[a]>='a')&&(str[a]<='z')) bo[str[a]-'a']=true;
			else if (str[a]=='+') bo[26]=true;
				else if (str[a]=='*') bo[27]=true;
					else if (str[a]=='#') bo[28]=true;
						else if (str[a]=='@') bo[29]=true;
							else if (str[a]=='$') bo[30]=true;
								else if (str[a]=='%') bo[31]=true;
									else if (str[a]=='^') bo[32]=true;
										else bo[33]=true;
	for (a=0;a<34;a++)
		if (bo[a]==true) s++;
	cout<<s;
    fclose(stdin); 
    fclose(stdout); 
    return 0; 
}