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;

    }

  • 相关阅读:
    DLS的迷茫
    DFS系统
    前辈的一次培训
    BAV99 开关二极管
    学习射频IC卡 MFRC522,入手了一块板子
    Olink出新版本了 兼容JlinkV8 带串口功能
    Keil中慎用Printf()
    Keil : Cannot enter Debug Mode解决方法:
    热敏打印机应用笔记
    MFRC522 晶震不起震
  • 原文地址:https://www.cnblogs.com/2014acm/p/3874362.html
Copyright © 2011-2022 走看看