有以下程序 #include"iostream.h" void main() { int i=1,j=1,k=2; if((j++||k++)&
有以下程序 #include"iostream.h" void main() { int i=1,j=1,k=2; if((j++||k++)&&i++) cout < < i < < "," < < j < < "," < < k; cout< <end1; } 执行后输出结果是
A.1,1,2
B.2,2,1
C.2,2,2
D.2,2,3
有以下程序 #include"iostream.h" void main() { int i=1,j=1,k=2; if((j++||k++)&&i++) cout < < i < < "," < < j < < "," < < k; cout< <end1; } 执行后输出结果是
A.1,1,2
B.2,2,1
C.2,2,2
D.2,2,3
A.ABCDE\0FG\0IJK
B.ABCDIJK
C.IJK
D.EFGIJK
A.6 1
B.7 0
C.6 3
D.7 1
有以下程序
#include <stdio.h>
#include <string.h>
typedef struct{ char name[9];char sex; float score[2]; } STU;
STU f(STU a)
{ STU b={"Zhao",'m',85.0,90.0}; int i;
strcpy(a.name,b.name);
a.sex=b.sex;
for(i=0;i<2;i++) a.score[i]=b.score[i];
return a;
}
main()
{ STU c={"Qian",'f',95.0,92.0},d;
d=f(c); printf("%s,%c,%2.0f,%2.0f\n",d.name,d.sex,d.score[0],d.score[1]);
}
程序的运行结果是
A)Qian,f,95,92
B)Qian,m,85,90
C)Zhao,m,85,90
D)Zhao,f,95,92
A.1
B.2
C.4
D.8
以下程序的功能是求两个非0整数相除的商和余数。程序有几处错误,试找出它们加以修改,并上机验证修改结果。 #include "iostream" using namespace std; int main() {int x,y,r1,r2; cin>>x>>y; if(x=0||y=0) cout<<”input else { if(x> y) r1=x/y; r2=x%y; else r1=y/x; r2=y%x; } cout<<”商=> <<” 余数="”<"> < <endl; system("pause"); return 0;>
以下程序的输出结果是_______。 #include<stdio.h> main() { int i; for(i=1;i<5;i++){ if(i%2)printf("*"); else continue; printf("#"); } printf("$\n"); }
A.*#*#*#$
B.#*#*#*$
C.*#*#$
D.#*#*$
A.#includeIRremote.h
B.#includeIRremote
C.#include
D.#include‘IRremote.h’
给定以下程序段
insert code public class foo {
public static void main (String[] args) throws Exception {
printWriter ut = new PrintWriter (new java.io.outputStreamWriter (System.out), true) ;
out.printIn(“Hello”);
}
}
要使程序能正确运行,在insert code处必须添加()语句。
A、import java.io.PrintWriter;
B、include java.io.PrintWriter;
C、import java.io.OutputStreamWriter;
D、include java.io.OutputStreamWriter;
(14 )以下程序用以删除字符串所有的空格,请填空。
#include <stdio.h>
main ()
{ char s[100]={ " Our teacher teach C language! " };int i,j;
for (i=j=0;s[i]!= ’ \0 ’ ;i++ )
if (s[i]!= ‘ ’ ) {s[j]=s[i];j++;}
s[j]= 【 14 】
printf (" %s\n " ,s ) ;
}