#include<bits/stdc++.h>
using namespace std;
int s[101];
int n,top,x;
int main()
{
cin>>n;
top=0;
while(n)//进栈
{
top++;
s[top]=n%8;
n/=8;
}
while(top>0)//出栈
{
x=s[top];
top--;
cout<<x;
}
return 0;
}
模板 25:十进制转八进制(栈)
最新推荐文章于 2024-07-25 12:39:48 发布