[解題報告][ZeroJudge][d586] 哈密瓜美語 七月 12, 2010 程式碼, ZeroJudge 本文总阅读量次 12345678910111213141516171819202122232425262728293031/*Problem: d586 "哈密瓜美語" from jack1Language: C++Result: AC (22ms, 794KB) on ZeroJudgeAuthor: m80126colin at 2010-07-12 19:45:53Solution: String Processing*/#include <iostream>#include <string>using namespace std;int main() { char ch; int s3[27],i,j,n,m; string s1=" mjqhofawcpnsexdkvgtzblryui",s2=" uzrmatifxopnhwvbslekycqjgd"; for (i=1;i<s2.size();i++) s3[s2[i]-'a'+1]=i; while (~scanf("%d",&n)) { for (;n;n--) { scanf("%d ",&m); ch=cin.peek(); if (ch>='a'&&ch<='z') { for (j=0;m;m--) cin>>ch,j+=s3[ch-'a'+1]; printf("%d\n",j); } else { for (;m;m--) scanf("%d",&j),putchar(s1[j]); puts(""); } } }} Newer [解題報告][ZeroJudge][d587] 參貳壹真好吃 Older [解題報告][ZeroJudge][d584] 技能點數skill