/ 科创班 /

记录详情

Accepted


  
# 状态 耗时 内存占用
#1 Accepted 4ms 360.0 KiB
#2 Accepted 4ms 472.0 KiB
#3 Accepted 4ms 384.0 KiB
#4 Accepted 3ms 384.0 KiB
#5 Accepted 2ms 412.0 KiB
#6 Accepted 4ms 384.0 KiB
#7 Accepted 3ms 512.0 KiB
#8 Accepted 3ms 512.0 KiB
#9 Accepted 2ms 512.0 KiB
#10 Accepted 3ms 492.0 KiB

代码


#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
 
int Sum(int a, int n)
{
	assert(n > 0);
	int sum = 0;
	int temp = a; 
	for (int i = 0; i < n; i++)
	{
		sum = sum + a;
		a = (a * 10) + temp; 
	}
	return sum;
}
int main()
{
	int a = 0;
	int n = 0;
	scanf("%d", &a);
	scanf("%d", &n);
	printf("%d\n", Sum(a, n));
	system("pause");
	return 0;
}

信息

递交者
类型
递交
题目
5.5特殊求和
题目数据
下载
语言
C
递交时间
2018-07-18 19:30:11
评测时间
2018-07-18 19:30:11
评测机
分数
100
总耗时
38ms
峰值内存
512.0 KiB