全部评论 1

  • 第二个是

    #include<iostream>//递归
    using namespace std;
    void dfs(int n){//定义
       //边界
     if(n==0) return;//条件
        cout<<n%10;//看上面的代码
        dfs(n/10);
    }//也可以写在下面(void dfs(int n)要写在上面申明)
    int main(){
        int n;
        cin>>n;
        dfs(n);
        return 0;
    }
    

    2天前 来自 四川

    0

热门讨论