|
year=2021 if (year%400==0) or ( year%4==0 and year%100!=0 ): days=366 else: days=365 print(days) ⑴程序运行结果是:。 |
a=88 b=48 c=a//b If c==0: c=a*10+b . elif 1<=c<=9: c=a*100+b elif 10<=c<=99: c=a*1000+b print(c) ⑵程序运行结果是:。 |
|
for i in range(1,10,2): print(iend=" ") ⑶程序段执行结果是:。 |
for i in range(1,100): if i%3==0 and i%7==0: print(iend=" ") ⑷程序段执行的结果是:。 |
Private Sub Form_Click( )
Dim a, b, c, s As Integer
a=9
b=41
c=2*(a+b)
s=a*c
Private Sub Form_Click( )
Dim a As Integer, b As Integer
If a>b Then
a=a-b
Else
a=b+a
End if
Print a
Private Sub Form_Click( )
Dim x As Integer, a As Integer
x=0
a=0
For j=1 to 5
a=a+j
Next j
x=j
Print x, a
End Sub
Private Sub Form_Click( )
Dim x As Integer
x=0
Do While x<50
x=(x+2)*(x+3)
n=n+1
Loop
Print x,n
End Sub
Private Sub Command1_Click()
Dim x As Integer
x = Val(Text1.Text)
Select Case x
Case Is >= 450
Text2.Text = "优秀"
Case Is >= 400
Text2.Text = "良好"
Case Is > 350
Text2.Text = "中等"
Case Is >= 300
Text2.Text = "及格"
Case Else
Text2.Text = "不及格"
End Select
End Sub
语法错误:
该程序运行后,若在文本框中输入350,则输出为:
a=10, i=10
If i>10 then
a=a+i
Else
a=a-i
End if

Private Sub Command1_Click( )
Dim a As Single
Dim b As Single
Dim total As Single
a = Val(Text1. Text)
b =Val(Text2. Text)
total =
Text3. Text =
End Sub
图1
Private Sub Command1_Click( )
w= val (Text1. text)
if then
f=38
Else
f=
End If
Text2. text=f
End Sub
a=int(input("请输入买苹果的斤数:")
if :
s=10*a
else:
s=8*a
print("苹果费用:"+str(s))
s="abcdefg"
c=len(s) #len 求字符串长度
for i in range(0,c):
if i<2:
print (chr(ord(s[i])+2),end=" ") # ord()函数是chr()函数配对函数,将字符转ASCII值
else:
print(chr(ord(s[i]) + 3),end=" ")
x=3.772
y=-8
x=int (x) +abs (y)
print (x)
x=float(input('请输入用水量:')
if x<=100:
print('您的水费是',x*0.6,'元')
elif x>100 and x<=200:
print('您的水费是',x*0.7,'元')
else:
print('您的水费是',x*0.9,'元') *
Dim a As Integer, b As Integer
a=6
b=8
S=1+a*b/2
Print S
a=5
b=2
c=3
d=(a*b)%c
print(d)
x=4 y=3
if x>y:
print(x)
else:
print(y)
屏幕上输出的内容是()
x=10
y=3
Print(x%y,x**y)