123456789101112131415161718192021222324
#include <iostream> using namespace std; int reverse(int n) { int x, y, i, k; while(x) { if(n>0||n<0) { x=n%10;n=n/10; y=i*10+x; i++; } } return y; } int main() { int n; cin>>n; cout<< reverse(); return 0; }
123456
main.cpp:30:20: error: too few arguments to function ‘int reverse(int)’ 30 | cout<< reverse(); | ^ main.cpp:12:5: note: declared here 12 | int reverse(int n) | ^~~~~~~
if (n)
12
int x, y, i, k; while(x)
123
int x, y, i, k; ... y=i*10+x;