当前位置:网站首页>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;
}边栏推荐
- DDK for XP
- 分布式事务(Seata) 四大模式详解
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
- 编程语言:类型系统的本质
- Doris学习笔记之数据表的创建
- 7-20 print 99 formula table (format output)
- 7-24 reduction of the simplest fraction (rolling Division)
- 表单文本框的使用(一) 选择文本
- Understanding of closures
- 7-3 rental (20 points)
猜你喜欢

puzzle(016.4)多米诺效应

分布式事务(Seata) 四大模式详解

Doris学习笔记之数据表的创建

tonybot 人形机器人 首次开机 0630

puzzle(016.3)千丝万缕

Accelerating strategy learning using parallel differentiable simulation

Understand the application scenario and implementation mechanism of differential segment

US stock listing of polar: how can the delivery of 55000 units support the valuation of more than 20billion US dollars

泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东

Leetcode (4) -- find the median of two positively ordered arrays
随机推荐
How Facebook moves instagram from AWS to its own server
Selective sorting
Four data flows and cases of grpc
Tailing rushes to the scientific and Technological Innovation Board: it plans to raise 1.3 billion, and Xiaomi Changjiang is the shareholder
Raft agreement
tonybot 人形机器人 首次开机 0630
Thread. Sleep and timeunit SECONDS. The difference between sleep
etcd集群权限管理和账号密码使用
Zzuli:1040 sum of sequence 1
7-3 rental (20 points)
Luogu p4047 [jsoi2010] tribal division solution
Common commands for getting started with mongodb database
修改数据库中的记录为什么报这个错
Understand the application scenario and implementation mechanism of differential segment
x86汇编语言-从实模式到保护模式 笔记
Ultra simple mobile map development
7-22 tortoise and rabbit race (result oriented)
使用并行可微模拟加速策略学习
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
7-9 one way in, two ways out (25 points)