写出下列程序的运行结果。#include “stdio.h”Main(){ int a()={1,2,3,-4,5};int m,n,*p; p=&a; m=*(p+1); n=*(p+4);printf(“%d %d %d ”,*p,m,n); }
1 2 5
1 2 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;}
阅读下列程序,则在执行后,程序的运行结果为 #include"stdio.h" #include"string.h" main() { char a[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"); printf("%s\n",a);}
A.nice to meet you you
B.nice to
C.meet you you
D.nice to you
下列程序的运行结果为【 】。 include <stdio.h> main() { static char str1[40]; char str2140]; strcpy(str2,"China"); strcat(str1,str2); strcat(str1," is a great country !"); printf("%s %s ",str2,strl); printf("%d %d\n",strlen(str2),strlen(str1)); }
A.1221
B.2112
C.123
D.312
阅读下列程序,请写出程序的运行结果。
import java.applet.*;
import javax.swing.*;
import java.awt.event.*;
public class C extends Applet implements ActionListener
{
int n=0;
JButton button;
public void init()
{
setSize(400,100);
button=new JButton("");
add(button);
button.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
n++;
button.setText(n+"");
}
}
A.5
B.6
C.7
D.8