当前位置:网站首页>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;
}
边栏推荐
- pyQt界面制作(登录+跳转页面)
- Adc128s022 ADC Verilog design and Implementation
- 7-18 finding the single root of polynomial by dichotomy
- Raft agreement
- 7-22 tortoise and rabbit race (result oriented)
- Puzzle (016.4) domino effect
- Luogu p5536 [xr-3] core city solution
- Sendmail无法发送邮件及发送过慢解决
- Code writing and playing method of tonybot humanoid robot at fixed distance
- C language,%d% Difference between 2D%2d%02d
猜你喜欢
Tonybot Humanoïde Robot Infrared Remote play 0630
Puzzle (016.3) is inextricably linked
论文分享:Generating Playful Palettes from Images
Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in
表单文本框的使用(一) 选择文本
Understand the application scenario and implementation mechanism of differential segment
Code writing and playing method of tonybot humanoid robot at fixed distance
Luogu p5018 [noip2018 popularization group] symmetric binary tree problem solution
Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
Paper sharing: generating playful palettes from images
随机推荐
Paper sharing: generating playful palettes from images
How to query the baby category of tmall on Taobao
556. The next larger element III
Sendmail can't send mail and it's too slow to send. Solve it
Although not necessarily the best, it must be the hardest!
retrofit
使用并行可微模拟加速策略学习
Find the sum of the elements of each row of the matrix
洛谷P3065 [USACO12DEC]First! G 题解
7-3 count the number of words in a line of text
Zabbix添加Calculated items后保存页面成空白
分布式事务(Seata) 四大模式详解
MongoDB数据库入门的常用命令
Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
Some concepts about agile
Address book sorting
别再问自己适不适合做软件测试了
光猫超级账号密码、宽带账号密码 获取
556. 下一个更大元素 III : 简单构造模拟题
C language,%d% Difference between 2D%2d%02d