0
点赞
收藏
分享

微信扫一扫

PTA L1-055:谁是赢家 (python)

归零者245号 2022-03-11 阅读 125

一、题目要求

在这里插入图片描述
在这里插入图片描述

二、参考代码

n=[int(i) for i in input().split()]
s=input()
if s.count(str(n.index(max(n))))>0:
    if n.index(max(n))==0:
        print('The winner is a: %s + %d'%(n[0],s.count('0')))
    else:
        print('The winner is b: %s + %d'%(n[1],s.count('1')))
else:
    if n.index(min(n))==0:
        print('The winner is a: %s + %d'%(n[0],s.count('0')))
    else:
        print('The winner is b: %s + %d'%(n[1],s.count('1')))
举报

相关推荐

pat L1-055 谁是赢家(python)

谁是赢家 (10 分)

PTA L1-027 python实现

PTA L1-017 python实现

PTA L1-034 python实现

PTA L1-032 python实现

0 条评论