当前位置:网站首页>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)

边栏推荐
- [CNN] Why is the convolution kernel size of CNN usually odd
- What does the expression > > 0 in JS mean
- MySQL installation and configuration tutorial (super detailed, nanny level)
- NPM replace the latest Taobao image
- MySQL的存储过程
- 面试被问到了String相关的几道题,你能答上来吗?
- Idea2021.2 installation and configuration (continuous update)
- Event extraction and documentation (2018)
- Feign call fails. JSON parse error illegal character ((ctrl-char, code 31)) only regular white space (R
- DCAT in laravel_ Admin preliminary use record
猜你喜欢

Attack and defense world web master advanced area web_ php_ unserialize

Where is sandbox's confidence in rejecting meta's acquisition of meta universe leader sand?

Api 接口优化有哪些技巧?

Attack and defense world web master advanced area PHP_ rce

Leetcode64. Minimum path sum

"Method not allowed", 405 problem analysis and solution

IDEA报错Error running ‘Application‘ Command line is too long解决方案

Virtual lab basic experiment tutorial -8. Fourier transform (1)

Using recursion and chain header interpolation to realize the group turnover of linked lists -- leetcode25 K group turnover linked lists

Introduction and solution of common security vulnerabilities in web system CSRF attack
随机推荐
Kali installs burpsuite professional
Do like and in indexes in MySQL go
Event extraction and documentation (2018)
研发效能的道法术器
2022网络安全学习路线 非常详细 推荐学习
[applet project development -- JD mall] uni app commodity classification page (first)
MySQL stored procedure
Applet editor rich text editing and rich text parsing
Dynamic programming (V)
MySQL transaction (this is enough...)
NPM replace the latest Taobao image
Centos7 install mysql8
Principle of meter skipping
@PostConstruct注解详解
Detailed explanation of the usage of exists in MySQL
Sword finger offer 55 - I. depth of binary tree
[small bug diary] Navicat failed to connect to MySQL | MySQL service disappeared | mysqld installation failed (this application cannot run on your computer)
Detailed principle explanation and verification results of digital clock based on FPGA
Field injection is not recommended solution
Dynamic programming problem (2)