#22019: 測試AC,結果RE


smith990547@gmail.com (吳冠辰)

學校 : 國立臺東大學
編號 : 109519
來源 : [140.127.41.251]
最後登入時間 :
2024-03-28 13:53:32
a054. 電話客服中心 -- 板橋高中教學題 | From: [110.50.178.52] | 發表日期 : 2020-08-10 14:30

#include<iostream>

#include<string>

using namespace std;

int main()

{

int a[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};

char b[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 x,m,temp,y,t1,t2;

int mip;

int sum;

string str = "";

while(cin >> x){

    mip = 1;

    sum = 0;

if(x%10==0)

m = 0;

else

m = 10 - x%10;

y = x/10;

while(y>0){

sum = sum + (y%10)*mip;

mip++;

y/=10;

}

for(int i=0;i<27;i++)

{

    t1 = a[i]%10;

    t2 = a[i]/10;

    temp = t1*9 + t2*1 + sum;

    if(temp%10==m)

        str = str + b[i];

}

cout<<str<<'\n';

}

}

懇求大佬們幫忙

 
ZeroJudge Forum