-
有以下程序: include <stdio.h> void f(); } 执行后的输出结果【 】。
-
以下程序的运行结果是【 】。 include<stdio.h> main() { int fun(); fun();} fun (
以下程序的运行结果是【 】。 include<stdio.h> main() { int fun(); fun();} fun () { static int a[3]={0,1,2}; int i; for(i=0;i<3;i++)a[i]+=a[i]; for(i=0;i<3;i++)printf("%d,",a[i]); printf("\n");}
-
有以下程序: include<stdio.h> main() {printf("%d\n",NULL)); 程序运行后的输出结果是()。
A.0
B.1
C.-1
D.NULL没定义,出错
-
有以下程序: include<stdio.h> main { char s[]="rstuv"; printf("%c\n",*s+2); }
有以下程序: include<stdio.h> main { char s[]="rstuv"; printf("%c\n",*s+2); } 程序运行后的输出结果是()。
A.tuv
B.字符t的ASCIl码值
C.t
D.出错
-
若有以下程序 include<stdio.h> main(){ inta=-11.b=10; a/=b/=4: printf(%d%d\n,a,b);
若有以下程序 include<stdio.h> main(){ inta=-11.b=10; a/=b/=4: printf(%d%d\n,a,b);} 则程序的输出结果是
A.-1-2
B.5-2
C.4-3
D.41762
-
若有以下定义,则表达式“a * b + d – c”的值的类型为 include <stdio.h> int main() { char a; int b; float c; double d; .... return 0; }
A.char
B.double
C.float
D.int
-
有以下程序: include<stdio.h> main() { int i,j,m=55; for(i=
有以下程序: include<stdio.h> main() { int i,j,m=55; for(i=1;i<=3;i++) for(j=3;j<=i;j++)m=m%j; printf(“9/6d\n”,m); } 程序的运行结果是()。
A.0
B.1
C.2
D.3
-
若有如下程序: include"stdio.h" void main() {FILE *fp; fp=fopen("test","wb"); fprintf(fp,"%d%.1f,%c%c",5,238.41,'B','h'); fclose(fp); } 则程序运行后向文件输出的结果是()。
A.5238.41Bh
B.5238.4,Bh
C.5,238.4,B,h
D.5238.41Bh
-
若有以下程序 include<stdio.h> main(){ inta=0,b=0,c=0c=(a+=++b,b+=4); printf(%d,%d,
若有以下程序 include<stdio.h> main(){ inta=0,b=0,c=0c=(a+=++b,b+=4); printf(%d,%d,%d\0n,a,b,c);) 则程序的输出结果是
A.1,5,1
B.-1,4,4
C.1,5,5
D.-1,4,-1
-
以下程序的功能是计算:s=1+12+123+1234+12345。请填空。 include<stdio.h>int main()
-
有以下程序 include<stdio.h>void main()
A.10 9 8
B.9 8 7
C.10 9 8 7
D.9 8 7 6
-
若有以下程序include<stdio.h>int a[]={2,4,6,8};main(){int i; int *p=a; for(i=0;i<4;i++)a[i
若有以下程序 include <stdio.h> int a[]={2,4,6,8}; main() { int i; int *p=a; for(i=0;i<4;i++)a[i]=*p; printf("%d\n",a[2]);} 上面程序输出结果是
A.6
B.8
C.4
D.2
-
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。【C++程序】include < stdio. h >include
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。
【C++程序】
include < stdio. h >
include < string. h >
define Max 1000
class Bank
{
int index;
char date [Max] [10]; // 记录交易日
iht amount[Max]; // 记录每次交易金额,以符号区分存钱和取钱
int rest[ Max]; // 记录每次交易后余额
static iht sum; // 账户累计余额
public:
Bank() {index =0;}
void deposit(char d[ ] , int m) //存入交易
{
strcpy (date [ index ], d);
amount[ index] = m;
(1);
rest[ index] = sum;
index++;
}
void withdraw (char d[ ], int m) //取出交易
{
strcpy(date[ index] ,d);
(2);
(3);
rest[ index] = sum;
index++;
}
void display();
};
int Bank:: sum = 0;
void Bank:: display () //输出流水
{
int i;
printf("日期 存入 取出 余额\n");
for (4)
{
printf(" %8s" ,date[i] );
if (5)
printf(" %6d" , -amount[i] );
else
printf("%6d ",amount[i] );
printf("% 6d\n" ,rest[i] );
} }
void main()
{
Bank object;
object. deposit ("2006.2.5", 1 00 );
object. deposit("2006.3.2" , 200);
object. withdraw("2006.4.1", 50);
object. withdraw("2006.4.5", 80);
object. display ();
}
本程序的执行结果如下:
日期 存入 取出 余额 2006.2.5 100 100
2006.3.2 200 300
2006.4.1 50 250
2006.4.5 80 170
-
有以下程序(strcat函数用以连接两个字符串) include<stdio.h> include<string.h>。
有以下程序(strcat函数用以连接两个字符串) include<stdio.h> include<string.h>。 main {char a[20]="ABCD\oEFG\0",h[]="IJK"; strcat(a,b);printf("%s\n",a); ) 程序运行后的输出结果是()。
A.ABCDE\0FG\0IJK
B.ABCDIJK
C.IJK
D.EFGIJK
-
有以下程序 include<stdio.h>include<string.h>void fun(); } 程序运行后的输出结果是
A.012345
B.876543210
C.876543
D.012345678
-
有以下程序includ<stdio.h>main(){printf("%"NUL);}程序运行后的输出结果是()
A.1
B.变量无定义,输出不确定
C.-1
D.0
-
有以下程序 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
-
以下程序的输出为()include<stdio.h>void main(){inty=5;while(y--);printf("y=%d\n",y);}</stdio.h>
A.y=0
B.无限循环,无结果输出
C.y=1
D.y=-1
-
若有以下程序 include <stdio.h> int main() { int a = 0, b = 0, c = 0, d; c = (a += b,,b += a); /*第5行*/ d = c;; /*第6行*/ ; /*第7行*/ ;printf("%d, %d, %d\n", a, b,c); /*第8行*/ return 0; } 编译时出现错误,你认为出错的是()
A.第5行
B.第6行
C.第7行
D.第8行
-
若有以下程序 include<stdio.h> min();/*第7行*/ } 编译时出现错误,你认为出错的是第4行 B.第5行 C.第6行 D.第7行
A.第4行
B.第5行
C.第6行
D.第7行
-
有以下程序: include<stdio.h> main() } int y=9; for(y>0;
有以下程序: include<stdio.h> main() } int y=9; for(y>0;y--) if(y%3==0)printf(“%d”,--y); } 程序的运行结果是()。
A.741
B.963
C.852
D.875421
-
有以下程序include ’stdio.h’min()} 程序的运行结果是3 B.5C.7 D.8
A.3
B.5
C.7
D.8
-
若输入I have a test.,则以下程序的运行结果为【 】。 include<stdio.h> main(); }
-
有以下程序 include<stdio.h> include<stdio.h> intfun()); } 程序的运行结果是10 B.20 C.0 D.出错
A.10
B.20
C.0
D.出错