#include<iostream>
#include<sstream>
#include<iomanip>
using namespace std;
int main(){
int integer;
string str;
double doulb;
while(cin>>str){
stringstream strm(str);
if(strm>>integer &&strm.eof()==1)
cout << "Integer: " << showbase << hex << integer << endl;
else{
strm.str(str);
if(strm>>doulb && strm.eof()==1)
cout << "Double: " << fixed << setprecision(6) << doulb << endl;
else
cout << "String: " <<str<< endl;
}
}
return 0;
}
时间: 2024-10-11 07:08:19