求sn=a+aa+aaa+aaaa+…的值 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include<math.h> int main() { int a; int n; int i; int sum = 0; int s = 1; scanf("%d %d", &a, &n); for (i = 0; i <= n-1; i++) { sum = s * a + sum; s = s + pow(10, i + 1); } printf("%d", sum); return 0; }