更多"下面程序的执行结果是 【15】 。 #include <iostre"的相关试题:
[填空题]下面程序的执行结果是 【15】 。
#include <iostream.h>
void main( )
int n=0,x=0;
do
n++;
if(n%3==2&&n%5==3&&n%7==2)
x=1;
while(x!=1);
cout<<"n="<<n<<end1;
[填空题]以下程序运行时输出到屏幕的结果是 【7】。
#include
void main( )
{int i=1,m=0;
switch(i)
{ case 1:
case 2: m++;
case 3: m++;
}
printf("%d",m);
}
[填空题]下面程序的输出结果是 【9】 。
#include<iostream.h>
void main( )
{
int a[6]={1,2,3,4,5,6};
for(int i=0;i<5;i++)
cout <<a[i] <<" ";
cout <<end1;
}
[填空题]下面程序的运行结果是 ______。
#include<iostream.h>
void main( )
char str[]="SSSWLIA",c;
int k;
for(k=2;(c=str[k]!=’/0’;k++)
switch(c)
case’I’:++k;break;
case’l’;continue;
default;cout<<c;continue;
cout<<’*;
[填空题]以下程序的执行结果是 ______。
#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;
[填空题]下面程序的执行结果是 【15】 。
#include <iostream. h>
void main( )
{
int n=0,x=0;
do
{
n++;
if(n%3==2&&n%5==3&&n%7==2)
x=1;
}while(x!=1);
cout<<"n=" <<n<<end1;
}
[填空题]下面程序的执行结果是 【15】 。
#include <iostream. h>
void main( )int n=0,x=0;
don++;
if(n%3==2&&n%5==3&&n%7==2)
x=1;
while(x!=1);
cout<<"n=" <<n<<end1;
[填空题]下面程序的执行结果是
[7] 。
#include<iostream.h>
void main( )
int a=0,b=2,c=0,d=30;
if(
- a)
d=d-10;
else if(B)
if(!C)
d=15;
else d=20;
cout<< “d=” <<d<<end1;
[填空题]以下程序的输出结果是 [10] 。
#include<iostream. h>
void main( )
int *p;
p=new int;
*p=200;
cout<<*p;
delete p;
[填空题]以下程序的输出结果是 [11] 。
#include<iostream. h>
void main( )
int a[]= 1, 3, 5, 7, *p=a, i;
for (i=0; i<4: i++)
a[i]=*p++;
cout<<a[2];
[填空题]以下程序的输出结果是 [8] 。
#include <iostream. h>
void main( )
char *x[6] = "Would" , "you" , "like" , "C" "Plus" "Plus"
int i=0;
while (i < 4)
if (i==3)
cout<<x[i]<< "" ;
else
cout<<x[i]<<" ";
i++;
cout<<end1;
[填空题]下列程序的输出结果是 【13】 。
#include<iostream.h>
void main( )
int i(1),j(2),k(3),a(10);
if(!i)
a--;
else if(j)
if(k)a=5;
else
a=6;
a++;
cout<<a<<endl;
if(i<j)
if(i!=3)
if(!k)
a=1;
else if(k)
a=5;
6+=2;
cout<<a<<endl;
[填空题]下列程序的输出结果是 【7】 。
# include<iostream. h>
void main( ) {
char a[]= "abcdabcabfgacd"
int i1=0,i2=0,i=0;
while (a[i])
{
if (a[i]="a") i1++;
if (a[i]=="b") i2++;
i++;
}
cout <<i1<<" "<<i2<<end1;
}
[填空题]以下程序的输出结果是 【7】 。
#include<iostream.h>
void main( )
{
int a=0;
a+ =(a=8) ;
cout<<a;
}