#include#define LENGTH 100#define NUMBER 8int scan() { int data; printf("Input your data :"); scanf("%d",&data); return data; } void display(char array[],int index) { for(int j=index-1; j>=0; j--) { printf("%d",array[j]); } printf("\n"); } void conversion(int data) { char array[LENGTH]; int i=0; printf("%d 转换成八进制后为:", data); while(data){ array[i++]=(char)(data%8); data /= NUMBER; } display(array, i); } int main() { conversion(scan()); return 1; }