View Code of Problem 86

#include<stdio.h>
int main(){
	int a,n;
	scanf("%d %d",&a,&n);
	int b=a;;
	int sum=a;
	
	for(int i=1;i<n;i++){
		b=10*b+a;//每次加 		
		sum+=b;	
	}
	printf("%d",sum);
	
	
	return 0;
}

Double click to view unformatted code.


Back to problem 86