写出下列程序输出结果()。#include<stdio.h >main(){int a=3, b=5,s; ;s=a*b;printf (s=%d/n, s);}
第1题
请写出下列程序的输出结果。()
#include
int main() /{
char str[ ]="1A2B3C4D"; int i;
for(i=0;str[i]!='/0';i++)
if ((str[i]<'0') || (str[i]>'9'))
printf("%c",str[i]);
return 0;
/}
}
第3题
请写出如下程序的输出结果:
#include void Swap(int &a, int & b);void main(){int x(10 ), y(7 );
cout<< "x="<< x<< " y="<< y<< endl;Swap(x , y );cout<< "x="<< x<< " y="<< y<< endl;
}void Swap(int & a, int & b){ int temp; temp = a ; a=b ; b=temp ; }
第4题
阅读下列程序并写出程序运行结果。
Private Sub Form_Click()
Dim A(1 To 3) As String
Dim c As Integer
Dim j As Integer
A(1) = "4"
A(2) = "8"
A(3) = "12"
c = 1
For j = 1 To 3
c = c + Val(A(j))
Next j
Print c
End Sub
写出程序运行时单击窗体后,窗体Form1上的结果。
第5题
写出下列程序的运行结果。
#include void Fun(){int num=20;cout<< "The Fun's num is"<< num<< endl;
}void main(){int num=10;cout<< "The main's num is "<< num<< endl;Fun();{int num=30;
cout<< "The Field's num is "<< num<< endl;}cout<< "The main's num is "<< num<< endl;}
第6题
第7题
A.13542
B.54321
C.12345
D.123
第9题
写出以下程序的运行结果。
#include int fun(int a){int b=0;static int c=3;b ; c ;return(a b c);}
main(){int i, a=5;for (i=0; i<3; i )cout<< i<< " "<< fun(a)<< " ";}
第10题
写出以下程序的运行结果。public class Test2 {public static void main(String args[ ]){int i,j;int a[]={17,91,65,35,28};for (i = 0; i < a.length-1; i++ ) {int k = i;for(j = i; j < a.length; j++ )if (a[j]>a[k] )k = j;int temp =a[i];a[i] = a[k];a[k] = temp;}for (i =0; i<a.length; i++ )System.out.print(a[i]+" ");System.out.println();} }
第11题
class A
{
int a;
A(int b)
{a=b;}
void show()
{System.out.println(“a=”+a);}
}
public class Class1
{
public static void main (String args[])
{
A bj=new A(12345);
boolean b=false;
char ch=97;
obj.show();
System.out.println(“b=”+b+”/tch=”+ch);
}
}