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

边栏推荐
- Control fillet stroke materialshapedrawable
- @PostConstruct注解详解
- Principle of meter skipping
- 动态规划问题(七)
- Dynamic programming problem (3)
- @Detailed explanation of the use of transactional annotation
- 分布式限流 redission RRateLimiter 的使用及原理
- Laravel8 middleware realizes simple permission control
- Where is sandbox's confidence in rejecting meta's acquisition of meta universe leader sand?
- CV instance segmentation model sketch (1)
猜你喜欢

MySQL transaction (this is enough...)

DCAT in laravel_ Admin preliminary use record

Newscenter, advanced area of attack and defense world web masters

Compilation principle research study topic 2 -- recursive descent syntax analysis design principle and Implementation

MySQL installation and configuration tutorial (super detailed, nanny level)

Simple use and understanding of laravel message queue

Advanced area of attack and defense world web masters -baby Web

Sword finger offer 55 - I. depth of binary tree

Google browser, no installation required

curl (7) Failed connect to localhost8080; Connection refused
随机推荐
html+css+php+mysql实现注册+登录+修改密码(附完整代码)
@Detailed explanation of the use of transactional annotation
Centos7 install mysql8
Software designer - intermediate, exam summary
2022网络安全学习路线 非常详细 推荐学习
Android studio connects to MySQL and completes simple login and registration functions
聊聊异步编程的 7 种实现方式
Leetcode62. Different paths
CV semantic segmentation model sketch (2)
Application of Devops in Internet of things solutions
【小程序项目开发 -- 京东商城】uni-app 商品分类页面(上)
Geth installation
Idea connection database
Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
Using recursion and chain header interpolation to realize the group turnover of linked lists -- leetcode25 K group turnover linked lists
MySQL 分库分表及其平滑扩容方案
Advanced area of attack and defense world web masters warmup
R语言怎么学
#{}和${}的区别
Laravel8 middleware realizes simple permission control