a054.
電話客服中心
--
板橋高中教學題
| From: [211.20.233.254] |
發表日期
:
2012-07-17 14:16
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
int line,temp=0;
char data[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
int number[26]={ 10,11, 12, 13, 14, 15, 16, 17, 34, 18, 19, 20, 21, 22, 35, 23, 24, 25, 26, 27, 28, 29, 32, 30, 31, 33,};
int ans[26];
while(cin>>line)
{
int i=0;
while(i<8)
{
temp+=((int)(line/pow(10.0,8-i))%10)*(8-i);
i++;
}
for(int i=0;i<26;i++)
{
ans[i]=10-((temp+(number[i]/10%10)+(number[i]%10*9))%10);
if(ans[i]==line%10)
cout<<data[i];
}
cout<<endl;
temp=0;
}
return 0;
}
一直都出現
WA (line:2)~找不到錯誤阿QQ拜託各位大大了 :'(