当前位置:网站首页>PTA (daily question) 7-71 character trapezoid
PTA (daily question) 7-71 character trapezoid
2022-07-29 00:22:00 【Little Deng programmer who can write bugs】
Use from m To n The numeric characters of form a character ladder .
Input format :
First enter a positive integer T, Number of groups representing test data , And then there was T Group test data . Each set of test data input 2 It's an integer m、n(1≤m≤n≤9).
Output format :
For each group of test data , Output a with n-m+1 Yes , By digital m…n Trapezoidal arrangement , The length of each line is :m,m+1,m+2,……,n, The numbers in each line are m,m+1,m+2,……,n.
sample input :
1
3 6
sample output :
333
4444
55555
666666
Code :
# import math
#
# t = int(input())
# for i in range(t):
# m, n = map(int, input().split())
# for i in range(m, n+1):
# result = i
# for j in range(1, i):
# result += i*int(math.pow(10, j))
# print(result)
t = int(input())
for i in range(t):
m, n = map(int, input().split())
for i in range(m, n+1):
result = str(i)
for j in range(1, i):
result += str(i)
print(result)

边栏推荐
- 【小程序项目开发 -- 京东商城】uni-app 商品分类页面(上)
- Kali installs burpsuite professional
- What does the expression > > 0 in JS mean
- Real time data warehouse: Didi's real-time data warehouse landing practice
- Exchange 2013 SSL certificate installation document
- Advanced area of attack and defense world web masters unserialize3
- Web系统常见安全漏洞介绍及解决方案-sql注入
- 研发效能的道法术器
- Laptop external display
- Attack and defense world web master advanced area web_ php_ include
猜你喜欢

动态规划问题(五)

Linux下安装Mysql5.7,超详细完整教程,以及云mysql连接

Samsung asset management (Hong Kong) launched yuancosmos ETF to focus on investing in the future tuyere track

Application of Devops in Internet of things solutions

vscode下链接远程服务器安装插件失败、速度慢等解决方法

Okaleido ecological core equity Oka, all in fusion mining mode

Field injection is not recommended solution

MySQL事务(transaction) (有这篇就足够了..)

Real time data warehouse: meituan's implementation of real-time data warehouse construction based on Flink

Api 接口优化有哪些技巧?
随机推荐
2022 network security learning route is very detailed, recommended Learning
mysql中exists的用法详解
110道 MySQL面试题及答案 (持续更新)
With this, your messages can't be monitored
@Transactional 注解使用详解
还在写大量 if 来判断?一个规则执行器干掉项目中所有的 if 判断...
vulnhub:BTRSys2
MySql中的like和in走不走索引
Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
MySQL的存储过程
Installation and use of pnpm
SQL实现将多行记录合并成一行
动态规划问题(一)
Attack and defense world web master advanced area web_ php_ include
研发效能的道法术器
Network traffic monitoring tool iftop
【MySQL系列】MySQL数据库基础
Servlet运行原理_API详解_请求响应构造进阶之路(Servlet_2)
CV instance segmentation model sketch (1)
MySQL安装配置教程(超级详细、保姆级)