当前位置:网站首页>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)
边栏推荐
- Exchange 2013 SSL certificate installation document
- Have passed hcip and joined the company of your choice, and share the learning experience and experience of Huawei certification
- Laptop external display
- Event extraction and documentation (2008-2017)
- PHP语言基础知识(超详细)
- Do like and in indexes in MySQL go
- Applet verification code login
- How NAT configures address translation
- Applet editor rich text editing and rich text parsing
- What does WGet mean
猜你喜欢
Compilation principle research study topic 2 -- recursive descent syntax analysis design principle and Implementation
Samsung asset management (Hong Kong) launched yuancosmos ETF to focus on investing in the future tuyere track
ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
Detailed explanation of 9 common reasons for MySQL index failure
SQL实现将多行记录合并成一行
CV instance segmentation model sketch (1)
AutoCAD -- import excel tables into CAD and merge CAD
Using recursion and chain header interpolation to realize the group turnover of linked lists -- leetcode25 K group turnover linked lists
Attack and defense world web master advanced area php2
MySQL transaction (this is enough...)
随机推荐
"Method not allowed", 405 problem analysis and solution
Leetcode62. Different paths
Leetcode63. Different paths II
ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
[applet project development -- JD mall] uni app commodity classification page (first)
IDEA 连接 数据库
Samsung asset management (Hong Kong) launched yuancosmos ETF to focus on investing in the future tuyere track
Multimodal model sketch (1)
Software designer - intermediate, exam summary
@Transactional 注解使用详解
Advanced area of attack and defense world web masters -baby Web
AutoCAD -- import excel tables into CAD and merge CAD
#{}和${}的区别
Opencv macro definition
vulnhub:BTRSys2
CV target detection model sketch (2)
Erc20 Standard Code
Introduction and solution of common security vulnerabilities in web system CSRF attack
Advanced area of attack and defense world web masters supersqli
动态规划问题(七)