八进制数输出和占位
Time Limit: 1000 ms Memory Limit: 65536 KiB
Submit Statistic
Problem Description
输入一个整数,请你按如下要求输出:
第一行按原样输出,
第二行以八进制靠右输出,不足 8 位左补 0 并在两端添加星号包裹,
第三行以八进制靠左输出,不足 8 位右补空格并在两端添加星号包裹。
Input
一个int范围内的正整数 a 。
Output
共三行,按题目描述输出。
Sample Input
123
Sample Output
123
00000173
*173 *
Hint
Source
行走的二叉树
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n;
scanf("%d",&n);
printf("%d\n",n);
printf("*%08o*\n",n);
printf("*%-8o*\n",n);
return 0;
}