-
若有以下程序 #include void f(int n) main() { void f(int n); f(5); } void f(int n); { printf("%d\n",n); } 则以下叙述不正确的是()
A . 若只在主函数中对函数f进行说明,则只能在主函数中正确调用函数f
B . 若在主函数前对函数f进行说明,则在主函数和其它函数中都可以正确调用函数f
C . 对于以上程序,编译时系统会出提示出错信息:提示对f函数重复说明
D . 函数f无返回值,所以可用void将其类型定义为无值型
-
有以下程序: #include void main( ) { ... while(getchar()!=\n); ... } 以下叙述正确的是( )
-
有以下程序: #include void main() {int k=5; while(--k) printf(%d,k-=3); printf(\n); }
-
有以下程序#include void main(){charstr[]={Hello,Beijing};printf(%d,%d\n,strlen(str),sizeof(str));}程序的运行结果是( )
-
有以下程序 #include void main() { int y=10; while(y--); printf('y=%d',y); } 程序执行后的输出结果是_______。
-
有以下程序 #include void main ( ) { chars[]=\012xy\\08s34f4w2
-
有以下程序: include <stdio.h> void f(); } 执行后的输出结果【 】。
-
若有以下程序include <stdio.h>void f(int n);main(){ void f(int n); f(5);}void f(int n){ printf("%d\n",n); }则以下叙述中不正确的是
A.若只在主函数中对函数f进行说明,则只能在主函数中正确调用函数f
B.若在主函数前对函数f进行说明,则在主函数和其他函数中都可以正确调用函数f
C.对于以上程序,编译时系统会提示出错信息:对f函数重复说明
D.函数f无返回值,所以,可用void将其类型定义为无返回值型
-
有以下程序 include<stdio.h>void main()
A.10 9 8
B.9 8 7
C.10 9 8 7
D.9 8 7 6
-
有以下程序include<iostream,h>int i=0;void fun(){{ Static int i=1 Std::cont<<i++<<','; } S
有以下程序 include<iostream,h> int i=0; void fun() { { Static int i=1 Std::cont<<i++<<','; } Std::cout<<i<<','; } int main() { fun();fun(); return 0; } 程序执行后的输出结果是()。
A.1,2,1,2,
B.1,2,2,3,
C.2,0,3,0,
D.1,0,2,0,
-
有以下程序:include<iostresm.h>void main(){int n;cin>>n;if (n++<10)cout<<n<<endl;elsecout<
有以下程序: include<iostresm.h> void main() { int n; cin>>n; if (n++<10) cout<<n<<endl; else cout<<n--<<endl; } 若执行上述程序时,从键盘上输入9,则输出结果是()。
A.11
B.10
C.9
D.8
-
有以下程序:include<iostream.h>void main(){ int x=5,y=2; cout<<!(y==x/2)<<","; cout<<y!=x%
有以下程序: include<iostream.h> void main() { int x=5,y=2; cout<<!(y==x/2)<<","; cout<<y!=x%3)<<","; cout<<(x>0&&y<0)<<","; cout<<(x!=y‖x>=y)<<endl: } 程序执行后的输出结果是()
A.0,0,0,1
B.1,1,1 1
C.0,0, 1,1
D.1,1,0,0
-
有以下程序 include<iostream.h> floatfun(int x,int y) {return(x+y);}void main() {int a=2,b
有以下程序 include<iostream.h> floatfun(int x,int y) {return(x+y);} void main() {int a=2,b=5,c=8; tout<<fun((int)fun(a+c,b),a-C);} 程序运行后的输出结果是
A.编译出错
B.9
C.21
D.9
-
若有以下程序:include <iostream>using namespace std;void sub(int x,int y, int *z){ *Z = y+
若有以下程序: include <iostream> using namespace std; void sub(int x,int y, int *z) { *Z = y+x; } int main() { int a,b,c; sub(8,4,&a); sub(6,a,&b); sub(a,b,&c); cout<<a<<","<<b<<","<<c<<endl; return 0; 程序运行后的输出结果是()。
A.12,18,30
B.-12,6,8
C.6,8,10
D.12,-18,16
-
有以下程序:include<stdlib.h>void fun(int* s,int* * d){* *d=*(s+2);}main(){ inta[]={1,2,3,
有以下程序: include <stdlib.h> void fun(int * s,int * * d) { * *d=*(s+2); } main() { int a[]={1,2,3,4,5},*b; b=(int *)malloc(sizeof(int)); fun(a,&B) ; printf("%d\n",*b+1); } 程序的输出结果是()
A.2
B.3
C.4
D.5
-
有以下程序,其中函数f的功能是将多个字符串按字典顺序排序()。 include<string.h> void f
有以下程序,其中函数f的功能是将多个字符串按字典顺序排序()。 include<string.h> void f(char*p[],int n) { char*t;int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j]>0){t=p[i];p[i]=p[j];p[j] =t;} } main { char *P[5]={"abe","aabdfg","abbd","dcd- be","cd"}; f(p,5); printf("%d\n",strlen(p[1])); } 程序运行后的输出结果是()o
A.2
B.3
C.6
D.4
-
有以下程序: include <stdio, h>void swap1 (int c0[],int e1[] ){intt;t = c0[0]; c0[0]: c1 [
有以下程序: include <stdio, h>void swap1 (int c0[],int e1[] ){ int t; t = c0[0]; c0[0]: c1 [0] ; c1 [0] = t;}void swap2(int * c0,int * c1){ int t; t= *c0; *c0= *c1; * c1 =t;}main(){ inta[2]={3.5}.b[2]={3,5}; swapl(a,a+1) ;swap2(&b[0],&b[1]); printf("% d %a %d %d \n" ,a[0] ,a[1] ,b[0] ,b[1] ); }程序运行后的车出结果是()。
A.3 5 5 3
B.5 3 3 5
C.3 5 3 5
D.5 3 5 3
-
有以下程序: include<stdio.h> void func(int n) { static int num=1); num=num+n;pri
有以下程序: include<stdio.h> void func(int n) { static int num=1); num=num+n;printf("%d",num); } main() { funo(3);func(4);printf("n"); } 程序运行后的输出结果是()。
A.4 8
B.3 4
C.3 5
D.4 5
-
有以下程序:include <stdio, h>void sum(int a[ ] ){a[0]=a[-1] +a[1];}main (){int a[10] = {
有以下程序:include <stdio, h>void sum(int a[ ] ){ a[0]=a[-1] +a[1];}main (){ int a[10] = {1,2,3,4,5,6,7,8,9,10}; sum(&a[2]); prinff("% d \n",a[2]); }程序运行后的输出结果是()。
A.6
B.7
C.5
D.8
-
有以下程序 include<stdio.h>include<string.h>void fun(); } 程序运行后的输出结果是
A.012345
B.876543210
C.876543
D.012345678
-
有以下程序 include<stdio.h>include<string.h>typedef struct stu { char name[10]; char gender; int score; } STU; void f(); } 程序的运行结果是
A.Zhao,m,290,Zhao,m,290
B.Zhao,m,290,Qian,m,290
C.Zhao,m,290,Qian,m,350
D.Zhao,m,290,Qian,f,350
-
有以下程序includevoid main(){int a ;scanf("%d",&a);if(a >= 0){if
A.A.-11 is a positive odd number.
B.B.-11 is a negative odd number.
C.C.-11 is a positive even number.
D.D.11 is a negative even number.
-
有以下程序: include struct stu { int num;char name[l0];int age;}; void fun(struct stu*p)
有以下程序: include struct stu { int num;char name[l0];int age;}; void fun(struct stu*p) { printf("%s\n",p->name);} main() { struct stu x[3]={{01,"Zhang",20),{02,"Wang",l9},{03,"Zha0",l8}}; fun(x+2); } 程序运行后的输出结果是()。
A.Zhang
B.Zhao
C.Wang
D.19
-
有以下程序: include struct STU{char name[9];char sex;int score[2];}; void f(struct STU a[
有以下程序: include struct STU{char name[9];char sex;int score[2];}; void f(struct STU a[]) { struct STU b={"Zhao",m,85,90); a[1]=b; } main() { struct STU c[2]={{"Qian",f,95,92},{"Sun",m 98,99}}; f(c); printf(”%s,%c,%d,%d,¨,c[o].name,c[o].sex,c[o].score[o],c[o].score[1]); printf("%s,%c,%d,%d\n",c[1].name,c[1].sex,c[1].score[o],c[1].score [1]); } 程序运行后的输出结果是()。
A.Zhao,m,85,90,Sun,m,98,99
B.Zhao,m,85,90,Qian,f,95,92
C.Qian,f,95,92,Sun,m,98,99
D.Qian,f,95,92,Zhao,m,85,90