char型转int型
string a;
for(auto c:f)
{
**int x=c-'a';**
a+=(char)x+'0';
}
int型转char型
string a;
for(auto c:f)
{
int x=c-'a';
**a+=(char)x+'0';**
}
string转int型(用stdlib库)
atoi函数可以直接删除前导零
string a,b,d;
int n,m,g;
n=atoi(a.c_str());
m=atoi(b.c_str());
g=atoi(d.c_str());
int型转string(string库)
bool check(int n)
{
**string s = to_string(n);**
int res = 0;
for (auto c: s)
res += c - '0';
return res % 4 == 0;
}