# include <stdio.h>
# include <string.h>
int main(void)
{
int i,n,q,r,s[100];
while(scanf("%d", &n) != EOF)
{
getchar(); //吸收回车符。
if(n < 0) break;
for(i = 0;; i++)
{
q = n / 8;
//printf("%d\n", q);
r = n % 8;
if(q == 0)
{
s[i] = r;
break;
}
s[i] = r;
n = q;
}
//printf("---%d\n", i);
for(; i >=0; i--)
{
printf("%d", s[i]);
}
printf("\n");
}
return 0;
}
1194 八进制
最新推荐文章于 2021-05-17 18:02:10 发布