利用cin/cout自带转换
进制转换
http://www.nowcoder.com/questionTerminal/8f3df50d2b9043208c5eed283d1d4da6
#include<iostream>
using namespace std;
int main(){
int a;
while(cin>>hex>>a){
cout<<dec<<a<<endl;
}
exit(0);
}进制转换
http://www.nowcoder.com/questionTerminal/8f3df50d2b9043208c5eed283d1d4da6
#include<iostream>
using namespace std;
int main(){
int a;
while(cin>>hex>>a){
cout<<dec<<a<<endl;
}
exit(0);
}相关推荐
查看20道真题和解析