阿拉伯数字转化为中文(缩写)数值:
#include<iostream>
#include<algorithm>
#include<vector>
#include<sstream>
using namespace std;
string tostring(int a){
stringstream ss;
ss<<a;
string res;
ss>>res;
return res;
}
int main(){
int a;
cin>>a;
string res;
vector<char>arr{'S','B','Q','W'};
int pos=0;
while(a!=0){
if(pos==5){
pos=1;
}
if(pos==0){
if(a%10){
res.push_back(char(a%10+'0'));
}
pos=pos+1;
}
else{
if(a%10){
res.push_back(arr[pos-1]);
res.push_back(char(a%10+'0'));
}
pos=pos+1;
}
a=a/10;
}
reverse(res.begin(),res.end());
cout<<res;
return 0;
}