更多"下述程序的输出结果是( )。 #include<stdio.h>"的相关试题:
[填空题]下述程序的输出结果是 【13】 。
# include <stdio.h>
void main( )
char c1[20]="1234";
char c2[20]="5678";
char *p1,*p2;
p1=c1;
p2=c2;
while(*p1++)
while(*p1++=*p2++);
printf("%s,c1);
[单项选择]下述程序的输出结果是()。
#include<stdio.h>
void main( )
int a[20],*p[4];
int i,k=0;
for(i=0;i<20;i++)
a[i]=i;
for(i=0;i<4;i++)
p[i]=&a[i*i+1];
for(i=0;i<4;i++)
k=k+*p[i];
printf("%d",k);
A. 10
B. 18
C. 6
D. 数组元素引用不合法,输出结果不定
[单项选择]下列程序的输出结果是 #include void main( )
{ char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!=’/0’;i++) switch(str[i]) {
case’1’:x4++; case’2’:x3++; case’3’:x2++;
case’4’:x1++; } cout < < x1 < < ","
< < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[单项选择]下列程序的输出结果是
#include
void main( )
char * str="12123434";
int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!=’/0’;i++)
switch(str[i])
case’1’:x4++;
case’2’:x3++;
case’3’:x2++;
case’4’:x1++;
cout < < x1 < < "," < < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[填空题]以下程序的输出结果是______。
#include
void main( )
{ int a=0;
a+=(a=8);
cout<<a;
}
[单项选择]下面程序输出的结果是
#include<iostream.h>
void main( )
inti;
int a[3] [3] =1,2,3,4,5,6,7,8,91;
for(i=0;i<3;i++)
cout < < a[2-i] [i] < < " "; A) 1 5 9 B) 7 5 3 C) 3 5 7 D) 5 9 1
[简答题]以下程序输出的结果是:
#include "stdio.h"
void main( )
{
char s[]="/"hello/"";
printf("%s",s);
}
[填空题]以下程序输出的结果是 。
#include<iostream.h>
void main( )
int a=5,b=4,c=3,d;
d=(a>b>c) ;
cout < < d;
[单项选择]以下程序的输出结果是
#include <iostream.h>
void main( )
int a=0,i;
for(i=1 ;i<5;i++)
switch(i)
case 0:
case 3: a+=2;
case 1:
case 2: a+=3;
default: a+=5;
cout<<a<<end1;
return;
A. 31
B. 13
C. 10
D. 20
[填空题]下述程序的输出结果是 【13】 。
# include <stdio.h>
void main( )
{
char c1[20]="1234";
char c2[20]="5678";
char *p1,*p2;
p1=c1;
p2=c2;
while(*p1++)
while(*p1++=*p2++);
printf("%s,c1);
}
[填空题]以下程序输出的结果是 【10】 。
#include<iostream.h>
void main( )
int a=5,b=4,c=3,d;
d=(a>b>c);
cout<<d;