- 1

Why the following code is running the results of -234 and 123?

#include <iostream> using namespace std; void f(int x) { int t; if(x<0){cout<<"-";x=-x;} t=x%10;x=x/10; if(x!=0)f(x); cout<<t; } int main() { f(-234); cout<<'\n'; f(123); cout<<'\n'; return0; }

29th Mar 2017, 3:02 AM
Dabenquan
Dabenquan - avatar
1 Respuesta
0
this program is very interesting. I can understand but can't explan.
29th Mar 2017, 1:07 PM
夏湘岭
夏湘岭 - avatar