C语言提供了几个标准库函数,可以将任意类型(整型.长整型.浮点型等)的数字转换为字符串.以下是用itoa()函数将整数转换为字符串的一个例子:# include <stdio.h># include <stdlib.h>void main (void){int num = 100;char str[25];itoa(num, str, 10);printf("The number 'num' is %d and the string 'str' is %s. \n&quo…
直接上代码: public class Main { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("十进制转换到其它进制:"); int x = 123 ; String str1 = Integer.toHexString(x) ; ///10进制转换成16进制的字符串 System.out.println(str1); String st…