# include "stdio.h"
Int main ()
{
Int a, n, s, t;
Printf (" both Please input a, n: \ n ");
The scanf (" % d % d ", & amp; A, & amp; N);
If (n & lt;=0)
Printf ("="s, s);
While (n> 0)
{
T=a;
S=s + t;
T=(t * 10) + a;
}
Printf (" s=% d ", s);
return 0;
}
O god! O (n)=a + aa + s aaa +,,,, + a.. + aa values, which is a number for a look at where I went wrong? No errors, but a run it is' s' undefined???????
CodePudding user response:
Should is not initialized, and s=0;
CodePudding user response:
reference 1st floor WQR1994 response: should is not initialized, and s=0; Instead of int s=0 also not ah CodePudding user response:
A values Cycle the first sentence is T=a; Constantly reset t Equal to the number you've been with the same CodePudding user response:
How that s not defined... CodePudding user response:
reference lin5161678 reply: 3/f a values Cycle the first sentence is T=a; Constantly reset t Equal to the number you've been with the same The while loop inside the first sentence is not I use the t=a? CodePudding user response:
reference 4 floor WQR1994 response: how that s not defined... I added but.. After input the a and n't results CodePudding user response:
# include "stdio.h" Int main () { Int a, n, s, t; Printf (" both Please input a, n: \ n "); The scanf (" % d % d ", & amp; A, & amp; N); If (n & lt;=0) { Printf (" s=% d ", 0). return 0; } S=0; T=a; //printf (" % d + t); While (n> 1) { S=s + t; T=(t * 10) + a; //printf (" % d + t); N -; } S +=t; //printf (" % d \ n ", t); Printf (" s=% d ", s); return 0; } For your reference ~ CodePudding user response:
The reference 7 building self-confidence boy reply: # include "stdio.h" Int main () { Int a, n, s, t; Printf (" both Please input a, n: \ n "); The scanf (" % d % d ", & amp; A, & amp; N); If (n & lt;=0) { Printf (" s=% d ", 0). return 0; } S=0; T=a; //printf (" % d + t); While (n> 1) { S=s + t; T=(t * 10) + a; //printf (" % d + t); N -; } S +=t; //printf (" % d \ n ", t); Printf (" s=% d ", s); return 0; } For reference ~ % d + and n -/what does it mean for advice CodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html