进制类问题
26进制,提醒我去刷类似的题
找一下规律:
A:1 * 1
B:2 * 1
AA:1 * 1 + 1 * 26
AB:2 * 1 + 1 * 26
AAA:1 * 1 + 1 * 26 + 1 * 26 * 26
BBA: 1 * 1 + 2 * 26 + 2 * 26 * 26
#include<iostream>
#include<algorithm>
#include<cstring>
#include<iomanip>
#include<vector>
#include<cmath>
#include<cctype>
#define IOS std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
#define pi acos(-1);
#include<map>
using namespace std;
typedef struct node{
}node;
typedef long long ll;
string s;
ll ans;
void ccin(){
cin>>s;
}
void work(){
for(auto ss: s){
ans*=26;
ans+=ss-'A'+1;
}
cout<<ans;
}
int main(){
IOS;
ccin();
work();
return 0;
}