当前位置: 首页 > news >正文

天梯赛训练L1-031——L1-040

天梯赛训练L1-031——L1-040

L1-031 到底是不是太胖了

import math
n = int(input())
for i in range(n):
    h,w = map(int,input().split())
    w /= 2
    biaozhun = (h - 100)* 0.9
    if math.fabs(biaozhun - w) < biaozhun * 0.1:
        print("You are wan mei!")
    elif w < biaozhun:
        print("You are tai shou le!")
    else :
        print("You are tai pang le!")

L1-032 Left-pad

n,ss =input().split()
n = int(n)
s = input()
ans = ''
if n > len(s):
    for i in range(n-len(s)):
        ans += str(ss)
    ans += s
    for i in range(n):
        print(ans[i],end = '')
else:
    print(s[len(s)-n::])

L1-033 出生年

a,b = map(int,input().split())
temp = a   
while(True):
    co = set()  
    for i in str(a):  
        co.add(i)
    if len(str(a)) < 4:
        co.add('0')
    if len(co) == b:   
        print("%d %04d" %(a-temp,a))
        break
    a += 1

L1-034 点赞

n = int(input())
ans = [0] * 1001
for i in range(n):
    num = list(map(int,input().split()))
    number = num[0]
    list_ = num[1::]
    for j in list(list_):
        ans[j] += 1
maxn = -1
j = 0
k = 0
for i in range(1,1001):
    if maxn <= ans[i]:
        maxn = ans[i]
        j = i
        k = ans[i]
print(j,k)

L1-035 情人节

lst = []
while True:
    t = input()
    if t == '.':
        break
    lst.append(t)
if 2>len(lst):
    print('Momo... No one is for you ...')
elif 2<=len(lst)<14:
    print(lst[1]+' is the only one for you...')
else:
    print(lst[1]+' and '+lst[13]+' are inviting you to dinner...')

L1-036 A乘以B

m,n = map(int,input().split())
print(m*n)

L1-037 A除以B

m,n = map(int,input().split())
if n == 0:
    ans = str(m) + '/' + str(n) + '=' + "Error"
    print(ans)
else :
    if n < 0:
        ans = str(m)+'/'+'('+str(n)+')'
    else :
        ans = str(m) + '/' + str(n)
    n = '%.2f' % (m/n)
    ans +='='+n
    print(ans)

L1-038 新世界

print("Hello World")
print("Hello New World")

L1-039 古风排版

n=int(input())
s=input()
for i in range(n):
    print( ''.join(reversed(s[i::n])).rjust(len(s[0::n]),' '))

L1-040 最佳情侣身高差

t = int(input())
for _ in range(t):
    xingbie,high = input().split()
    high = float(high)
    if xingbie == "M":
        print('%.2f' % (high/1.09))
    else :
        print('%.2f' % (high*1.09))

相关文章:

  • ImGui 学习笔记(六)—— 高 DPI 缩放
  • OpenCV计算摄影学(22)将输入的彩色图像转换为两种风格的铅笔素描效果函数pencilSketch()
  • 共享 IP 与独立 IP:长期邮件营销的优劣比较
  • 算法刷题整理合集(五)
  • ESP32(1)基于ESP32的lwIP了解
  • C# WPF编程-画刷(Brush)填充图形对象的颜色或图案
  • STM32——独立看门狗(IWDG)
  • Ollama + CherryStudio:构建本地私有知识库
  • 攻克 3D 模型网站建设难题,看迪威系统优势
  • 台达PLC转太网转换的教程案例(台达DVP系列)
  • 【WEB APIs】BOM-操作浏览器
  • Linux 操作系统简介
  • GLOW-TTS
  • gitlab将本地项目提交到远程dev分支
  • 基于SpringBoot + Vue 的图书商城系统
  • Word 小黑第20套
  • Java 买百鸡问题
  • 基于大模型的鼻中隔偏曲预测及手术治疗方案研究报告
  • Linux目录结构以及文件操作
  • Android 11.0 监听某个app启动获取应用使用时长功能实现
  • 以色列消防部门:已控制住耶路撒冷山火
  • 美国季度GDP时隔三年再现负增长,特朗普政府关税政策对美国经济负面影响或将持续
  • 北京亦庄启动青年人才创新创业生态示范区
  • 荣盛发展股东所持1.17亿股将被司法拍卖,起拍价约1.788亿元
  • 中国人保一季度业绩“分化”:财险净利增超92%,寿险增收不增利
  • 白云山一季度营收净利双降,此前称今年将挖掘盘活自身资源