1011:水题。

#include<bits/stdc++.h>
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define MS0(a) memset(a,0,sizeof(a))

using namespace std;

typedef long long ll;
const int maxn=1000100;
const int INF=1e9+10;
const ll MOD=1e9+7;
const double EPS=1e-13;

char s[maxn];
int n;
int cnt[1200];

int main()
{
    //freopen("in.txt","r",stdin);
    int T;cin>>T;int casen=1;
    while(T--){
        printf("Case #%d: ",casen++);
        MS0(cnt);
        scanf("%s",s+1);
        n=strlen(s+1);
        REP(i,1,n) cnt[s[i]]=1;
        int res=0;
        REP(i,0,1100) res+=cnt[i];
        printf("%d\n",res);
    }
    return 0;
}
View Code

相关文章:

  • 2022-12-23
  • 2021-12-21
  • 2021-12-31
  • 2022-12-23
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2018-08-26
  • 2022-12-23
相关资源
相似解决方案