a=14
b=30
select case b\10 ‘“\”是整除,运算结果只保留整数部分。
Case 0
c=a+b
Case 1 to 9
c=a*10+b
Case 10 to 99
c=a*100+b
End select
Print c
a=[2,'a']
print(a*2)
s=0
for i in range(101):
If
:
s=s+i
print (s)
print(9/3)
实现上述功能的程序如下,请在划线处填入合适的代码。
import math
def isprime(x):
for i in range(2,int(math.sqrt(x))+1):
if x % i = = 0 :
f=False
return f
n=int(input("请输入一个正整数 n:"))
c=0
k=3
while k < = n-2:
if isprime( k ) and:
c + = 1
print("第"+ str( c ) +"对双胞胎数:", k ,'和',k+2)
print("共有"+str(c)+"对双胞胎数")
Private Sub Command1_ Click()
a=Text2. Text '总评分
If a <75 Then
Label4. Caption ="★ 继续努力!"
Else
If a>90 Then
Label4. Caption ="★★★ 很棒!"
Else
Label4. Caption = "★★ 加油!"
End If
End If
End Sub