当前位置:网站首页>Zzuli:1052 sum of sequence 4
Zzuli:1052 sum of sequence 4
2022-07-03 14:34:00 【Snake_____】
Title Description
Input n and a, seek a+aa+aaa+…aa…a(n individual a), As if n=3,a=2 when ,2+22+222 As the result of the 246
Input
Contains two integers ,n and a, The meaning is as above , You can assume that n and a All are less than 10 Non-negative integer
Output
Before output n Xiang He , Take a line alone
The sample input Copy
3 2
Sample output Copy
246
#include <stdio.h>
int main()
{
int n,a,i,x=0,sum=0;
scanf("%d%d",&n,&a);
for(i=1;i<=n;i++)
{
x=x+a;
sum=sum+x;
a=a*10;
}
printf("%d",sum);
return 0;
}边栏推荐
猜你喜欢

protobuf与grpc

提高效率 Or 增加成本,开发人员应如何理解结对编程?

Eight sorts

Puzzle (016.4) domino effect

NPM install is stuck with various strange errors of node NPY

修改数据库中的记录为什么报这个错

556. The next larger element III

愉悦资本新双币基金近40亿元完成首次关账

Adc128s022 ADC Verilog design and Implementation

Tonybot humanoid robot starts for the first time 0630
随机推荐
Luogu p5018 [noip2018 popularization group] symmetric binary tree problem solution
中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿
洛谷P5018 [NOIP2018 普及组] 对称二叉树 题解
retrofit
Jiuyi cloud black free encryption free version source code
Zzuli:1040 sum of sequence 1
Four data flows and cases of grpc
US stock listing of polar: how can the delivery of 55000 units support the valuation of more than 20billion US dollars
Luogu p5194 [usaco05dec]scales s solution
Sub GHz wireless solution Z-Wave 800 Series zg23 SOC and zgm230s modules
Leetcode (4) -- find the median of two positively ordered arrays
Tonybot humanoid robot infrared remote control play 0630
剑指 Offer 28. 对称的二叉树
String reverse order
JVM garbage collector
Bibit pharmaceutical rushed to the scientific innovation board: annual revenue of 970000, loss of 137million, proposed to raise 2billion
pyQt界面制作(登录+跳转页面)
556. 下一个更大元素 III
Understanding of closures
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪