标签:style blog http color os io 2014 ar
#include<iostream> #include<string> using namespace std; int main() { const string hexdigits="0123456789ABCDEF"; cout<<"Enter a series of numbers between 0 and 15"<<" separates by spaces ,Hit ENTR when finished:"<<endl; string result; string::size_type n; while(cin>>n) { if(n<hexdigits.size()) result+=hexdigits[n]; cout<<"Yours hex number is:"<<result<<endl; } return 0; }
运行结果:
标签:style blog http color os io 2014 ar
原文地址:http://www.cnblogs.com/wuchanming/p/3887592.html