---
# System prepended metadata

title: a054
tags: [APCS]

---

# a054
```
#include <iostream>
using namespace std;


int main(){
    
    int x,a,b,c,d,e,f;
    int num[10]={};
    int total=0,check,temp;
    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};
    
    cin>>temp;
    for(int i=0;i<9;i++){
        num[9-i]=temp%10;
        temp=temp/10;

        if(i>0) total=num[9-i]*i+total;
        
    }

    // for(int i=0;i<9;i++){
    //     cin>>num[i];
    //     if (i!=8){
    //         total=num[i]*(8-i)+total;
    //         cout<<i<<" "<<total<<endl;
    //     }
    //     else check=num[i];
    // } 
    
    //x=10-num[9];
    for(int a=0;a<26;a++){
        b=(A[a]/10+A[a]%10*9+total)%10;
        if(10-b==num[9] or ((b==0) and (num[9]==0))) cout<<(char)(a+65);
    }
    //cout<<x;
    //cout<<x<<"\n"<<total;
    //a+b*9+total%10=x

}

```