码迷,mamicode.com
首页 > 其他好文 > 详细

8 八进制

时间:2014-07-29 11:46:56      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   io   2014   art   

 

 

bubuko.com,布布扣

 

 

bubuko.com,布布扣
#include <iostream>
using namespace std;
void f(int x)
{
    if(x<8) cout<<x;
    else {  cout<<x%8 ;  f(x/8); }
}
int main(int argc, char *argv[])
{
     int x;
     cin>>x;
     f(x);
    
    return 0;
}
View Code

 

 

 

#include <iostream>
using namespace std;
void f(int x)
{
 if(x<8) cout<<x;
 else {  cout<<x%8 ;  f(x/8); }
}
int main(int argc, char *argv[])
{
  int x;
  cin>>x;
  f(x);
 
 return 0;
}

 

 

 

 

 

*************************************************************************************************************************

 

 

bubuko.com,布布扣

 

 

 

 

bubuko.com,布布扣
#include <iostream>
using namespace std;
void f(int x)
{
    if(x>0)  {  f(x/8);  cout<<x%8  ;  } ;

}
int main(int argc, char *argv[])
{
     int x;
     cin>>x;
     f(x);
    
    return 0;
}
View Code
View Code

 

#include <iostream>

using namespace std;

void f(int x)

{     

 

   if(x>0) 

{             f(x/8);                    cout<<x%8  ;          }

 

}

 

int main(int argc, char *argv[])

{  

int x;  

cin>>x;  

    f(x);  

 return 0;

}

 

8 八进制,布布扣,bubuko.com

8 八进制

标签:style   blog   http   color   os   io   2014   art   

原文地址:http://www.cnblogs.com/2014acm/p/3874362.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!