头像

fifty-three

湖南工程学院计算机与通信学院(人工智能产业学院)




离线:10小时前


最近来访(1)
用户头像
HHzp

活动打卡代码 AcWing 670. 动物

a = input()
b = input()
c = input()
ans = {'vertebradoavecarnivoro' : 'aguia', 'vertebradoaveonivoro' : 'pomba', 'vertebradomamiferoonivoro' : 'homem',
    'vertebradomamiferoherbivoro' : 'vaca', 'invertebradoinsetohematofago' : 'pulga', 'invertebradoinsetoherbivoro' : 'lagarta',
    'invertebradoanelideohematofago' : 'sanguessuga', 'invertebradoanelideoonivoro' : 'minhoca'
}
print(ans[a+b+c])


活动打卡代码 AcWing 660. 零食

n, m = map(int, input().split())
d = {1: 4.00, 2: 4.50, 3: 5.00, 4: 2.00, 5: 1.50}
print("Total: R$ {:.2f}".format(m * d[n]))


活动打卡代码 AcWing 823. 排列

n = int(input())
ans = []
ls = [i for i in range(1, n+1)]
lt = []
def dfs(start, ls):
    if len(lt) == n:
        ans.append(lt[:])
        return
    for i in range(len(ls)):
        lt.append(ls[i])
        dfs(i+1, ls[:i] + ls[i+1:])
        lt.pop()
dfs(0, ls)
for i in ans:
    r = ' '.join(str(c) for c in i)
    print(r)


活动打卡代码 AcWing 756. 蛇形矩阵

n, m = map(int, input().split())
ans = [[0] * m for i in range(n)]
d = [(0, 1), (1, 0), (0, -1), (-1, 0)]
index = 0
x, y = 0, 0
cnt = 1
while cnt <= n * m:
    while 0 <= x < n and 0 <= y < m and ans[x][y] == 0:
        ans[x][y] = cnt
        cnt += 1
        if cnt > n*m:
            break
        ix, iy = d[index]
        x += ix
        y += iy
    ix, iy = d[index]
    x -= ix
    y -= iy
    index = (index + 1) % 4
    ix, iy = d[index]
    x += ix
    y += iy
# print(ans)
for i in ans:
    line = ' '.join(str(c) for c in i)
    print(line)



flag = input()
n = 12
grid = []
for i in range(n):
    grid.append(input().split())
cnt = 0
res = 0
for i in range(n-1, -1, -1):
    for j in range(n-1, i, -1):
        cnt += 1
        res += float(grid[i][j])
if flag == 'M':
    print("{:.1f}".format(res / cnt))
else:
    print("{:.1f}" .format(res))


活动打卡代码 AcWing 726. 质数

n = int(input())
nums = []
for i in range(n):
    nums.append(int(input()))

def is_prime(x):
    if x <= 1:
        return False
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return False
    return True
for i in nums:
    if is_prime(i):
        print(f"{i} is prime")
    else:
        print(f"{i} is not prime")


活动打卡代码 AcWing 721. 递增序列

# file = 'test.text'
# with open(file, r) as fi:
#     contents = fi.readlines()
# for read in contents:
#     print(i for i in range(1, int(read) + 1), end = ' ')

nums = []
a = input()
while a != '0':
     nums.append(int(a))
     a = input()
# print(nums)
for i in nums:
    res = []
    for j in range(1, i+1):
        res.append(j)
    res = ' '.join(str(i) for i in res)
    print(res)



活动打卡代码 AcWing 760. 字符串长度

i = input()
print(len(i))


活动打卡代码 AcWing 665. 倍数

a, b = map(int, input().split())
if max(a, b) % min(a, b):
    print("Nao sao Multiplos")
else:
    print('Sao Multiplos')


活动打卡代码 AcWing 608. 差

a = int(input())
b = int(input())
c = int(input())
d = int(input())
print("DIFERENCA = %d" % (a * b - c * d))