include stdio include stdlib int main int res int tmp int printf Input

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <stdlib.h>
int main() {
int x, res=0;
int tmp;
int n=1;
printf("Input x: ");
scanf("%d",&x);
while(x>=8||x<=-8){
tmp=x%8;
x/=8;
res+=n*tmp;
n*=10;
}
res+=n*x;
printf("resultate=%d \n",res);
system("PAUSE");
return 0;
}