#include<iostream.h> class a { int b; public: void infer() { cout<<"请输入一个整数"<<endl; cin>>b; } void turn() { cout<<hex<<b<<endl; } }; void main() { for(int j=0;;j++) { a c; c.infer(); cout<<"则其十六进制为"<<endl; c.turn(); int i; cout<<"如果想继续输入请按1,否则按0"<<endl; cin>>i; if(i) continue; else break; } }