Problem1845--使用函数求特殊a串数列和

1845: 使用函数求特殊a串数列和

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 0
[Submit] [Status] [Web Board] [Creator:]

Description

给定两个均不超过9的正整数a和n,要求编写函数求a+aa+aaa++⋯+aa⋯a(n个a)之和。 函数接口定义: int fn( int a, int n ); int SumA( int a, int n ); 其中函数fn须返回的是n个a组成的数字;SumA返回要求的和。 裁判测试程序样例: #include int fn( int a, int n ); int SumA( int a, int n ); int main() { int a, n; scanf(

Input

两个均不超过9的正整数a和n

Output

其中函数fn须返回的是n个a组成的数字;SumA返回要求的和。

Sample Input Copy

2 3

Sample Output Copy

fn(2, 3) = 222
s = 246

Source/Category

208