首页 > 编程语言 >2023.5 路桥中学高一期末程序素养检测

2023.5 路桥中学高一期末程序素养检测

时间:2023-05-24 21:34:59浏览次数:46  
标签:elif int 高一 range 2023.5 input print 素养 sum

参考答案(个人编写)

A

a, b = map(int, input().split( ))
c = int(input())
print(c - a + b)

B

a = float(input())
print("%.2lf" %(a * 9 / 5 + 32))

C

a = float(input())
if a > 3:
    a = int(a)
    print(((a + 1 - 3) * 2 + 10))
else:
    print(10)

D

a = input()
b = list(a)
b.sort(reverse=True)
ans = int(''.join(b))
print(ans)

E

a, b, c = input().split()
a = int(a)
b = int(b)
c = str(c)
if c == '+':
    print(a + b)
elif c == '-':
    print(a - b)
elif c == '*':
    print(a * b)
elif c == '//':
    if b == 0:
        print("Error")
    else:
        print(a // b)
elif c == '%':
    print(a % b)
else:
    print("Error")

F

a = str(input())
b = a[0]
if b == 'A':
    print('Hangzhou')
elif b == 'B':
    print('Ningbo')
elif b == 'C':
    print('Wenzhou')
elif b == 'E':
    print('Huzhou')
elif b == 'F':
    print('Jiaxing')
elif b == 'G':
    print('Jinhua')
elif b == 'H':
    print('Quzhou')
elif b == 'I':
    print('Taizhou')
elif b == 'J':
    print('Taizhou')
elif b == 'K':
    print('Zhoushan')
elif b == 'L':
    print('Lishui')
else:
    print('Input error')

G

a = list(input())
b = len(a) // 2 + len(a) % 2
c = a[:b]
d = a[b - len(a) % 2:len(a)]
d.reverse()
# print(b, c, d)
print("Yes" if c == d else "No")

H

a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
a%=b
p=0
ans=""
n=a
while(p<c):
    n%=b
    n*=10
    ans+=str(n//b)
    p+=1

print(ans)

I

a = list(map(float, (input().split(','))))
ssum = sum(a)
a.sort()
print("%.2lf %.2lf"%(ssum / len(a), a[0]))

J

print(__import__('datetime').datetime.strptime(input(),'%Y-%m-%d').timetuple().tm_yday)

K

def is_perfect_number(n):
    m = 1
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            m += i + n // i
    return m == n
n = int(input())
for n in range(2, n+1):
    if is_perfect_number(n):
        print(n) 

L

n = int(input())
for i in range(1, n+1):
    b = ""
    for j in range(1, i+1):
        b += str(j)
    for j in range(i-1, 0, -1):
        b += str(j)
    print(" " * (n-i) + b)

M

n = int(input())
is_prime = [True] * (n+1)
is_prime[0] = is_prime[1] = False
for i in range(2, n+1):
    if is_prime[i]:
        for j in range(i*i, n+1, i):
            is_prime[j] = False
ans = sum(1 for x in is_prime if x)
print(ans)

N

a, n = map(int, input().split())
b = 0
for i in range(1, n + 1):
    b = b + int(str(a)*i)
print(b)

O

m = int(input())
for i in range(m):
    s = input()
    sum = 0
    if any(c.isupper() for c in s):
        sum += 1
    if any(c.islower() for c in s):
        sum += 1
    if any(c.isdigit() for c in s):
        sum += 1
    if any(c in ['~', '!', '@', '#', '$', '%', '^'] for c in s):
        sum += 1
    if len(s) >= 8 and len(s) <= 16 and sum >= 3:
        print('YES')
    else:
        print('NO')

标签:elif,int,高一,range,2023.5,input,print,素养,sum
From: https://www.cnblogs.com/EraYes/p/17429540.html

相关文章

  • 2023.5.24每日总结
    <%@pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"&g......
  • 2023.5.24——软件工程站立会议(阶段二)
    站立会议内容:1.整个项目预期的任务量:目前已经花的时间:剩余的时间:2.任务看板照片: 3.团队照片: 4.产品状态:最新做好的功能:正在完成中5.燃尽图:......
  • 2023.5.24——软件工程日报
    所花时间(包括上课):6h代码量(行):0行博客量(篇):1篇今天,上午学习,下午学习。我了解到的知识点:1.了解了一些数据库的知识;2.了解了一些python的知识;3.了解了一些英语知识;5.了解了一些Javaweb的知识;4.了解了一些数学建模的知识;6.了解了一些计算机网络的知识;......
  • 2023.5.24编程一小时打卡
    一、问题描述:已知Horse类是Pegasus类的父类,根据以下主函数完善程序内容,以实现规定的输出。不允许改变主函数的内容。intmain(){Horse*p1=newHorse;//输出:Horse申请了空间...Horse*p2=newPegasus;/*输出两行:Horse申......
  • 2023.5.24-人件-5月份读后感2
    最近,我阅读了人件的下一部分,有了一些感想。过去,我对于办公环境的重视程度不够。假设除了现在的职责之外,还让你负责为手下提供办公环境和公益设施。你必须为每个人确定工作环境的种类、分配的开支总数等等,而你如何着手做这些事呢?在以后,可以更加重视办公的环境。过去,我认为加班是......
  • 2023.5.23
     1#include<iostream>2#include<iomanip>3usingnamespacestd;4floatPI=3.14159f;5classShape6{7public:8virtualfloatgetArea()=0;9};10classCircle:publicShape11{12public:13floatr;14float......
  • day77(2023.5.23)
    1.JSP简介 2.JSP运行原理 3.JSP标签的使用运行结果: 4.JSP原始标签的使用 运行结果:5.JSP的指令标签6.JSP的内置对象 7.请求转发 8.请求转发案例 运行结果: 9.JSP中的四大作用域对象 10.JS......
  • 2023.5.23编程一小时打卡
    一、问题描述:定义抽象基类Shape,由它派生出五个派生类:Circle(圆形)、Square(正方形)、Rectangle(长方形)、Trapezoid(梯形)和Triangle(三角形),用虚函数分别计算各种图形的面积,输出它们的面积和。要求用基类指针数组,每一个数组元素指向一个派生类的对象。PI=3.14159f,单精度浮点数计算。输......
  • 2023.5.23每日总结
    <%@pageimport="wangzhan.Thesql"%><%@pageimport="wangzhan.Pd_P_assignment"%><%@pageimport="wangzhan.Pd_S_assignment"%><%@pagelanguage="java"contentType="text/html;charset=UTF......
  • 编程一小时2023.5.23
    1.#include<iostream>#include<cstring>#include<algorithm>usingnamespacestd;chartran(charc){return(int)(c-'A'-4)>0?(c-5):(c+21);}stringsd,str,ed,eof="ENDOFINPUT";intmain(){strings;while(getline(ci......