Home > Back-end >  C 'new for help, thank you for your bosses
C 'new for help, thank you for your bosses

Time:03-14

[problem description]

Input two integers a (greater than or equal to 1 and less than or equal to 9) and n (greater than or equal to 1 and less than or equal to 80), programming is obtained and the output value of the equation below:

22. The JPG

For example: if the input of a is 5, n is 6, the value of the formula to calculate the following:

555555-55555-5-5555-555-55,

[form] input

Read from standard input integer a and n, which are separated by a space,

[] output form

In the formula for output calculation results on the standard output,

[the sample 1 input]

5 6

[the sample 1 output]

493830

[the sample 1 shows]

Input a is 5, n is 6, according to the results of the formula for 493830,

[the sample 2 input]

5 20

[the sample 2 output]

49382716049382716060

[the sample 2 shows]

Input a is 5, n is 20, according to the results of the formula for 49382716049382716060,
My code:
#include
#include
using namespace std;
Int main () {
Int a, n, I, j=0;
Cin> A> n;
Long long s/n + 1={0, 0}, x.
I=n - 1;
Do
{the for (I=0; iS [j] + (10, I)=pow * a;
N -; j++; } while (n);
for(j=0; jCoutX=s [0];
For (j=1; jX=s [j];
Coutreturn 0;
} test why one is wrong, for big error correction to reassure

CodePudding user response:

Please ignore the
for(j=0; jCout
  • Related