当前位置:网站首页>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;
}边栏推荐
- 7-20 print 99 formula table (format output)
- retrofit
- 7-2 and then what time (15 minutes)
- Understand the application scenario and implementation mechanism of differential segment
- Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
- The mail function of LNMP environment cannot send mail
- 7-14 sum integer segments (C language)
- Too many files with unapproved license
- 【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?
- Eight sorts
猜你喜欢

Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them

puzzle(016.3)千丝万缕

puzzle(016.4)多米诺效应

Puzzle (016.4) domino effect

protobuf与grpc

Use of constraintlayout

Showmebug entered Tencent conference, opening the era of professional technical interview

NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线

7-15 calculation of PI

亚马逊、速卖通、Lazada、Shopee、eBay、wish、沃尔玛、阿里国际、美客多等跨境电商平台,测评自养号该如何利用产品上新期抓住流量?
随机推荐
Luogu p3065 [usaco12dec]first! G problem solution
Four data flows and cases of grpc
基因家族特征分析 - 染色体定位分析
Creation of data table of Doris' learning notes
Thread. Sleep and timeunit SECONDS. The difference between sleep
Recent learning summary
修改数据库中的记录为什么报这个错
7-20 print 99 formula table (format output)
String sort
Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
7-6 mixed type data format input
Paper sharing: generating playful palettes from images
Luogu p5536 [xr-3] core city solution
Bibit pharmaceutical rushed to the scientific innovation board: annual revenue of 970000, loss of 137million, proposed to raise 2billion
tonybot 人形机器人 红外遥控玩法 0630
Why is this error reported when modifying records in the database
Special research report on the market of lithium battery electrolyte industry in China (2022 Edition)
动态获取权限
1017 a divided by B (20 points)
pyQt界面制作(登录+跳转页面)