用函数解的(可参考)

凌愉晴  •  1个月前


#include<bits/stdc++.h>
using namespace std;
int f(int x){
	cout<<x%10;
	x/=10;
	if(x!=0) f(x);
}
int main(){
	int n;
	cin>>n;
	f(n);
}

评论: