CodePudding user response:
Depend, my eyes have problem, to see so bright images, eye particularly afflictive,CodePudding user response:
C + + code, only supplies the reference:# include & lt; Fstream>
using namespace std;
Int fn (int a, int n)
{
If (n==1) return a;
The else return a * (10 * fn (1, n - 1) + n);
}
Int main (void)
{
Int a, n.
Ifstream fin (" SC3_6C. In ");
Ofstream fout (" SC3_6C. Out ");
Fin & gt;> A. & gt;> n;
Fout & lt;
return 0;
}
CodePudding user response:
Pow is floating point, assign a value to an integer will produce truncation errors,CodePudding user response:
The other lining for lack of curly bracesCodePudding user response:
Second loop a little curly braces, should put the k=pow (10, j - 1); And sn=sn + a * k; Expansion in the second cycle,