1 #include <stdio.h> 2 void main() 3 { 4 char ch1,ch2,ch3; 5 scanf("%c%c%c",&ch1,&ch2,&ch3); 6 printf("%.3d %.3o %.3x\n",ch1,ch1,ch1); 7 printf("%.3d %.3o %.3x\n",ch2,ch2,ch2); 8 printf("%.3d %.3o %.3x",ch3,ch3,ch3); 9 }
没想到直接用输出方法
1 #include <stdio.h> 2 void main() 3 { 4 char ch1,ch2,ch3; 5 scanf("%c%c%c",&ch1,&ch2,&ch3); 6 printf("%.3d %.3o %.3x\n",ch1,ch1,ch1); 7 printf("%.3d %.3o %.3x\n",ch2,ch2,ch2); 8 printf("%.3d %.3o %.3x",ch3,ch3,ch3); 9 }
没想到直接用输出方法
转载于:https://www.cnblogs.com/zoti007/articles/9806805.html