#include <iostream > using namespace std; int main(){ int a=1,b=2,c=3,d=0; if(a==1 && b++==2) if(b!=2 || c--!=3) cout<<"<<"<<a<<b<<c; else cout<<a<<b<<c; else cout<<a<<b<<c; return 0; } 输出: 相关知识点: 试题来源: 解析 133 【详解】 ...
#include<iostream> using namespace std; int main() { int a=3,b=5,x,y; if(a<=b) x=1; else y=2; if(a>b) cout<<y; else cout<<x; return 0 ; } 相关知识点: 试题来源: 解析 这段程序的运行结果为:1。 在本程序中,第一个if语句成立,因为a小于等于b,所以将变量...
以下程序的输出结果是#include <iostream>using namespace std;int main(){ cout.fill('*'); cout.w
有以下程序: #include <iostream> using namespace std; int main() int y=18,i=0,j,a[8]; do a[i]=y%2; i ; y=y/2; while(y>=1); for(j=i-1;i>=0;j--) cout<<a[j]; cout return 0; 该程序执行后的输出结果是( )。
有以下程序: #include<iostream> using namespace std; int main() { int a=5, b=4, c=3,d=2; if(a>b>c) cout<<d<<end1; else if((c-1>=D) ==1) cout<<d+1<<end1; else cout<<d+2<<end1; return O;A、2B、3C、4
1有如下程序: #include <iostream> using namespace std; int main( ){ char str[100],*P; cout<<"please input a string:"; cin>>str; P=str; for(inti=0;*P!=’\0’;p++,i++); cout<<i<<endl; return 0; 运行这个程序时,若输入字符串为 Abcdefg abcd 则输出结果是 A.7B.12C.13D.100...
1若有以下程序: #include <iostream> using namespace Std; int main() int i ; int a[3] [3] = ’1’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’; for(i=0;i<3;i++) cout<<a[i] [1]<<" "; cout<<end1; return 0; 执行后的输出结果是( )。 A.50 53 56B.49 ...
有如下程序: #include <iostream> using namespace std; int main( ){ int*P; *P=9; cout<<"The value at P:"<<*P: return 0; } 编译运行程序将出现的情况是 A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value at P:9C.运行时一定输出:The value at P:*9D.运行时有可能出错...
#include<iostream> using namespace std; int main() char a[]="Hello,Test"; char *p=a; while(*p) if(*p>=’a’&&*p<=’z’) cout<<char(*p+’A’-’a’); else cout<<*p; p++; return 0; A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST 4下列程序的输出结果是( )。 #include...
#include<iostream> using namespace std; int main() { int i, j, s = 0; for (i = 1; i <= 5; i++) { s = 0; for (j = 0; j < 4; j++) s++; } cout << s; return 0; } 在这个程序中,有两个循环嵌套: 外层循环 for(i=1; i<=5; i++):i ...