标签:
22
代码一;
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
cin >> n;
printf("%o\n", n);
return 0;
}
代码二:
#include <iostream>
#include <cstdio>
using namespace std;
int num2=0, ans = 0;
int Fun(int m)
{
int i = 0;
while(m)
{
int temp = m%8;
for(int j=0; j<i; j++)
temp *= 10;
m /= 8;
i++;
ans += temp;
}
return ans;
}
int main()
{
int n;
cin>>n;
cout<<Fun(n)<<endl;
return 0;
}
标签:
原文地址:http://blog.csdn.net/u012965373/article/details/44960961