#include <fstream>
#include <string>
#include <cstdio>
#include <stack>
using namespace std;
#define _cdebbug
//全局数据
int main()
{
//重定向
#ifdef _cdebbug
freopen("F:\\input.txt","r",stdin );
#endif
long shu;
long temp;
int yushu;
stack<int> stk;
scanf("%d",&shu);
while (shu != 0)
{
yushu = shu % 8;
stk.push(yushu);
shu = shu / 8;
}
while (!stk.empty())
{
printf("%d",stk.top());
stk.pop();
}
printf("\n");
//解除重定向关闭文件
#ifdef _cdebbug
fclose(stdin);
#endif
return 0 ;
}
能有比这更基础的题目么
虽然基础,复习十进制转换任意进制方法:
除n取余到0,逆序排列