AC:
#include<iostream> using namespace std; int main() { int N; while(cin>>N) { int a[50],i=0; do{ a[i++]=N%8; N/=8; }while(N!=0); for(int j=i-1;j>=0;j--) cout<<a[j]; cout<<endl; } return 0; }
AC:
#include<iostream> using namespace std; int main() { int N; while(cin>>N) { int a[50],i=0; do{ a[i++]=N%8; N/=8; }while(N!=0); for(int j=i-1;j>=0;j--) cout<<a[j]; cout<<endl; } return 0; }
转载于:https://www.cnblogs.com/jianrenguo/p/6538088.html