zoukankan      html  css  js  c++  java
  • 8 八进制

    #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;
    }

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

    #include <stdio.h>
    void f(int n)
    {
      int i  ;
      if(n>0) 
      { 
       f(n/8) ;
       printf("%d",n%8) ;    
      }    
    }
    
    
    
    int main (  )
    {
    f(100);    
    }
    View Code

    #include <stdio.h>
    void f(int n)
    {
    int i ;
    if(n>0)
    {
    f(n/8) ;
    printf("%d",n%8) ;
    }
    }

    int main ( )
    {
    f(100);
    }

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

    #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;

    }

  • 相关阅读:
    带外数据
    数组中的第K个最大元素
    广播和多播
    反转链表
    ioctl操作
    非阻塞式I/O
    [CSP-S模拟测试]:简单的括号序列(组合数)
    [CSP-S模拟测试]:最大异或和(数学)
    关于我
    [CSP-S模拟测试]:礼物(数学)
  • 原文地址:https://www.cnblogs.com/2014acm/p/3874362.html
Copyright © 2011-2022 走看看