西北工业大学cpSkill平台Python作业NOJ(前二十题)

仅供参考
21-30传送门:https://blog.csdn.net/weixin_43520256/article/details/109137366
41-50传送门:https://blog.csdn.net/weixin_43520256/article/details/109137411
51-60传送门:
https://blog.csdn.net/weixin_43520256/article/details/109365933

61-70传送门:https://blog.csdn.net/weixin_43520256/article/details/109137461
71-80传送门:https://blog.csdn.net/weixin_43520256/article/details/109137497
81-90传送门:https://blog.csdn.net/weixin_43520256/article/details/109137524

永远的神:Hello World

# # 1
# print("Hello World")

在这里插入图片描述

# # 2
# a = int(input())
# b = int(input())
# print(a + b)

在这里插入图片描述

# # 3
# a = float(input())
# b = int(input())
# print(round(a,b))

在这里插入图片描述

# # 4
# 题目有Bug
# a = int(input())
# b = int(input())
# print(bin(a), bin(b), a & b, end=" ")

在这里插入图片描述

# # 5
# a = int(input())
# c = input()
# print(chr(a), ord(c), end=" ")

在这里插入图片描述

# # 6
# num = int(input())
# print(oct(num), hex(num), bin(num), sep=",")

在这里插入图片描述

# # 7
# num = int(input())
# print('{: <10}'.format(num))
# print('{: >10}'.format(num))
# n = abs(num)
# print('{: <10}'.format("+%d" % n))
# print('{: >10}'.format("+%d" % n))

在这里插入图片描述

# # 8
# f = float(input())
# print(round(f, 6), round(f, 2), round(f, 8), '{:.6e}'.format(f), format(f, ','), sep="/")

在这里插入图片描述

# # 9
# num = int(input())
# print('{0:b}'.format(num), '{0:o}'.format(num), oct(num), '{0:x}'.format(num), hex(num), '{0:#X}'.format(num), sep=',')

在这里插入图片描述

# # 10
# def to_bin(value, num):  # 十进制数据,二进制位宽
#     bin_chars = ""  # str
#     temp = value
#     for i in range(num):
#         bin_char = bin(temp % 2)[-1]
#         temp = temp // 2
#         bin_chars = bin_char + bin_chars
#     return bin_chars
#
#
# m = int(input())
# n = int(input())
# print(to_bin(m, n))

在这里插入图片描述

# 11
# import math
#
# x = int(input())
# y = int(input())
# x1 = math.sqrt((math.pow(x, 2) + math.pow(y, 2)))
# y1 = math.atan(y / x)
# print("%.4f" % x1, "%.4f" % y1, sep=",")

# import math
#
# x = int(input())
# y = int(input())
# if x != 0:
#     x1 = math.sqrt((math.pow(x, 2) + math.pow(y, 2)))
#     y1 = math.atan(y / x)
#     print("%.4f" % x1, "%.4f" % y1, sep=",")
# else:
#     print("除数不可以为0")

在这里插入图片描述

# # 12
# import math
#
# v = float(input())
# T = float(input())
# W = 13.12 + 0.6215 * T - 11.35 * math.pow(v, 0.16) + 0.3965 * T * math.pow(v, 0.16)
# print(round(W))

在这里插入图片描述

# # 13
# import fractions
#
# a = int(input())
# b = int(input())
# c = int(input())
# d = int(input())
# num1 = fractions.Fraction(a, c)
# num2 = fractions.Fraction(b, d)
# temp = num1 + num2
# print("(", num1, ")+(", num2, ")=", temp, sep='')
# temp = num1 - num2
# print("(", num1, ")-(", num2, ")=", temp, sep='')
# temp = num1 * num2
# print("(", num1, ")*(", num2, ")=", temp, sep='')
# temp = num1 / num2
# print("(", num1, ")/(", num2, ")=", temp, sep='')

在这里插入图片描述

# # 14
# person_age = float(input())
# if person_age <= 2:
#     dog_age = 10.5 * person_age
# else:
#     dog_age = (person_age - 2) * 4 + 10.5 * 2
# print(int(dog_age))

在这里插入图片描述

# # 15
# f = float(input())
# n = int(input())
# print(round(f, n))

在这里插入图片描述

# # 16
# import math
#
# h = float(input())
# r = float(input())
# V = math.pi * math.pow(r, 2) * h
# S = 2 * math.pi * math.pow(r, 2) + 2 * math.pi * r * h
# print("%.4f" % V, round(S, 4), sep="\n")

在这里插入图片描述

# # 17
# import math
#
# a = int(input())
# b = int(input())
# max = a if a > b else b
# min = a if a < b else b
#
#
# def isTriangle(a, b, c):  # 判断是否三角形
#     if a + b > c and a + c > b and b + c > a and abs(a - b) < c and abs(a - c) < b and abs(c - b) < a:
#         return True
#     else:
#         return False
#
#
# condition1 = int(math.sqrt(math.pow(max, 2) - math.pow(min, 2)))  # 直角边
# condition2 = int(math.sqrt(math.pow(max, 2) + math.pow(min, 2)))  # 斜边
# if (isTriangle(min, max, condition2) and math.pow(min, 2) + math.pow(max, 2) == math.pow(condition2,
#                                                                                          2) and condition2 > max):
#     print("c")
# elif isTriangle(min, max, condition1) and math.pow(min, 2) + math.pow(condition1, 2) == math.pow(max, 2):
#     if condition1 < min:
#         print("a")
#     if max > condition1 > min:
#         print("b")
# else:
#     print("non")
#
#
# def isTriangle(a, b, c):
#     if a + b < c:
#         return False
#     if a + c < b:
#         return False
#     if b + c < a:
#         return False
#     if abs(a - b) > c:
#         return False
#     if abs(a - c) > b:
#         return False
#     if abs(c - b) > a:
#         return False
#     return True

在这里插入图片描述

# # 18
# import fractions
#
# f = float(input())
# f = int(f * 10)
# a = 10
# num = fractions.Fraction(f, a)
# print(num)

在这里插入图片描述

# # 19
# def rgb2hsv(R, G, B):
#     R, G, B = R / 255.0, G / 255.0, B / 255.0  # R,G,B在 0 到 1 之间
#     Max = max(R, G, B)  # 最大值
#     Min = min(R, G, B)  # 最小值
#     m = Max - Min
#     V = Max
#
#     if V == 0:
#         S = 0
#     else:
#         S = m / Max
#
#     if Max == Min:
#         H = 0
#     elif Max == R:
#         H = ((G - B) / m) * 60
#     elif Max == G:
#         H = ((B - R) / m) * 60 + 120
#     elif Max == B:
#         H = ((R - G) / m) * 60 + 240
#
#     if H < 0:
#         H = H + 360
#
#     return H, S, V
#
#
# r = int(input())
# g = int(input())
# b = int(input())
#
# h, s, v = rgb2hsv(r, g, b)
# print("%.4f" % h, "%.4f%%" % (s * 100), "%.4f%%" % (v * 100), sep=",")

在这里插入图片描述

# 20
# import math
#
#
# def get_distance(L1, L2):
#     lon1 = math.radians(float(L1[0]))
#     lon2 = math.radians(float(L1[1]))  # 经度
#     lat1 = math.radians(float(L2[0]))
#     lat2 = math.radians(float(L2[1]))  # 纬度
#     lo = lon1 - lon2
#     la = lat1 - lat2
#
#     a = math.pow(math.sin(la / 2), 2) + math.cos(lat1) * math.cos(lat2) * math.pow(math.sin(lo / 2), 2)
#     D = 2 * math.asin(math.sqrt(a)) * 6371
#     return D
#
#
# w1 = input()  # 西安纬度
# j1 = input()  # 西安经度
# w2 = input()  # 莫斯科纬度
# j2 = input()  # 莫斯科经度
#
# l1 = [j1, j2]  # 经度集合
# l2 = [w1, w2]  # 纬度集合
# d = get_distance(l1, l2)
# print("%.4fkm" % d)

  • 13
    点赞
  • 44
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 13
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

枳洛淮南✘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值