用C++编写一个函数将十进制转换成十六进制

日期:2014-06-18 18:44:16 人气:1

用C++编写一个函数将十进制转换成十六进制

#include #include #define MAX 30 //main()的定义 int main(void) { char str[MAX],*p; //从键盘上输入int数 cout>n; //将整型数n按十进制转换为字符串并输出 p=itoa(n,str,10); cout>x; //将浮点数x转换为字符串后输出 p=gcvt(x,10,str); cout<<"str="<&l
    A+
热门评论