更多"以下由C语言编写的程序,运行后输出结果是______。 #inclu"的相关试题:
[填空题]以下由C语言编写的程序,运行后输出结果是______。
#include〈stdio.h〉
void fun(int x)
if(x/2>1)fun(x/2):
Printf(“%d”,x):
Main( )
fun(7);printf(“/n”);
[填空题]在窗体上画一个命令按钮,然后编写如下事件过程,程序运行后,单击命令按钮,输出结果是 【15】
Private Sub Command1_Click( )
Dim a(1 To 10)
Dim p(1 To 3)
k=5
For i = 1 To 10
a(i) = i
Next i
For i = 1 To 3
p(i) = a(i * i)
Next i
For i = 1 To 3
k=k+p(i) *2
Next i
Print k
End Sub
[单项选择]有下列程序,程序运行后单击命令按钮,则输出的结果是( )。
Private Sub Command1_Click( )
Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2#
For i=1 To 4
a(i)=i
Next i
For i=3 To 6
b(i)=i
Next i
s1=Factorial(
A.
B.
[单项选择]下面程序运行后,单击命令按钮,输出的结果是 Private Sub Command1_Click( ) Dim a%(1 To 4) , b%(2 To 6) , i%, str1#, str2# For i = 1 To 4 a(i) =i Next For i = 2 To 6 b(i) =i Next str 1 = YAG (a) str 2 = YAG (b) Print "str1 ="; str1; "str2 ="; str2 End Sub Function YAG(a( )As Integer) Dim t#,i% t=1 For i=LBound(a)TO UBound(a) t=t * a(i) Next YAG=t End Function
A. str1=24 str2=720
B. str1=12 str2=360
C. str1=24 str2=180
D. str1=36 str2=720
[单项选择]下面程序运行后,单击命令按钮,输出的结果是 Pivate Sub Cornmand1_Click( ) Dim a%(1 To 4),b%(2 To 6),i%,str1#,str2# For i=1 To 4 a(i)=i Next For i=2 To 6 b(i)=i Next str1=YAG(a) str2=YAG(b) Print"str1=";str1;"str2=";str2 End Sub Function YAG(a( )As Integer) Dim t#,i% t=1 For i=LBound(a)To UBound(a) t=t*a(i) Next YAG=t End Function
A. str1=24 str2=720
B. str1=12 str2=360
C. str1=24 str2=180
D. str1=36 str2=720
[填空题]下面程序运行后,单击命令按钮,输出的结果是 【12】
Private Sub Command1_Click( )
Dim a%(1 To 4),b%(2 To 6),i%,str1#,str2#
For i=1 To 4
a(i)=i
Next
For i=2 To 6
b(i) =i
Next
str1 = YAG(a)
str2 = YAG(b)
Print "str1 ="; str1; "str2 ="; str2
End Sub
Function YAG (a ( ) As Integer)
Dim t#, i%
t=1
For i = LBound(a) To UBound(a)
t=t * a(i)
Next
YAG = t
End Function
[填空题]下面程序运行后,单击命令按钮,输出的结果是【 】。
Private Sub Commandl_Click( )
Dim a%(1 To 4) ,b%(2 To 6) ,i%,strl#,str2#
For i=1 To 4
a(i) =i
Next i
For i=2 To 6
b(i) =i
Next i
str1 =YAG(a)
str2 =YAG(b)
Print"strl";str1;"str2=";str2
End Sub
Function YAG (a( )As Integer)
Dim T#,i%
t=1
For i=LBound(a) To UBound(a)
t=t * a(i)
Next i
YAG =t
End Function
[填空题]下面程序运行后,单击命令按钮,输出的结果是 (10) 。
Private Sub Command1_Click( )
Dim a%(1 To 5),1%,s#
For i=1 To 5
a(i)=i
Next
s=Fun(A)
Print“s=”;s;
End Sub
Function Fun(a( ) As Integer)
Dim t#,i%
t=1
For i=LBound(A) To UBound(A)
t=t*a(i)
Next
Fun=t
End Function
[单项选择]下列程序运行后的输出结果是( )。
public class Sun
public static void main(String args[ ])
int a,b;
a=0;
b=0;
for(int m=1;m<=10;m++)
a=a+1;
b=0;
for(int j=1;j<=10;j++)
a=a+1;
b=b+2;
System.out.println(a+","+B) ;
A. 10,20
B. 20,110
C. 110,20
D. 200,110
[单项选择]下列程序运行后的输出结果是( )。
public class Sun
public static void main (String args[
int i,j,s;
s=0;
for (i=1;i<=3;i++)
for(j=0;j<=i-1;j++)
s=s+1;
System.out.println(s);
A. 6
B. 5
C. 4
D. 3