Reversing Digits
In this lab you are going to write a recursive function, reverseDigits, which takes a positive integer as a parameter and returns the number with the digits reversed.
e.g.: if the argument is 1234 then the returned value of reverseDigits will be 4321; if the argument is 500 then the returned value will be 5.
下面係skeleton
#include <iostream>
using namespace std;
int reverseDigits(____________);
int main(){
int num;
cout << "Enter a number: ";
cin >> num;
cout << "The reversed number: " << reverseDigits(____________) << endl;
return 0;
}
int reverseDigits(________________)
{
/*** Your Code ***/
}
請懂得者回答,在your code到寫就得