有如下程序: #include<iostream> usingnamespacestd; intmain( ){ inta[6]={23,15,64,33,40,58}; ints1,s2; s1=s2=a[0]; for(int*p=a+1;p<a+6;p++){ if(s1>*p)s1=*p; if(s2<*p)s2=*p; } cout<<s1+s2<<endl; return0; } 运行时的输出结果是( )。
A.23
B.58
C.64
D.79
第1题:
有以下程序: #include <iostream> using namespace Std; int main( ) { int a = 15,b = 21,m = 0; switch(a%3) { case 0: m++; break; case 1: m++; switch(b%2) {
A.1
B.2
C.3
D.4
第2题:
有以下程序#include <iostream>using namespace std;int a;int fun ();int main (){ extern int a; int b; a = 100; b = fun(); cout<<b<<end1; return 0;}int fun{){ extern int a; return (10*a ;} 其程序运行后的输出结果是
A.100
B.10
C.1000
D.10000
第3题:
若有以下程序: #include <iostream> using namespace std; int main() { int a=3; cout<<(a+=a-=a+A) <<end1; return 0; } 程序执行后的输出结果是( )。
A.-6
B.12
C.0
D.-12
第4题:
有以下程序 #include<iostream> using namespace std; int a; int fun(); int main() { extern int a; int b; a=100; b=fun(); cout<<b<<endl; return 0; } int fun() { extern int a; return(10*a); } 其程序运行后的输出结果是( )。
A.100
B.10
C.1000
D.10000
第5题:
有以下程序: #include<iostream> using namespace std; int main () { int a[]={1,2,3, 4,5, 6, 7,8,9, 10, 11, 12}; int *p=a+5, *q=0; *q=* (p+5); cout<<*p<<" "<<*q<<end1; return 0; }
A.运行后报错
B.66
C.6 12
D.5 5
第6题:
1)#include
2)using namespace std;
3)int main()
4){
5)int a,b,result;
6)cout<<"please input two numbers:\n";
7)cin>>a>>b;
8)result=3*a-2*b+1;
9)cout<<"resultis"<< result<< endl;
10)}
程序的第5行中的cout表示:()
A、显示字符串
B、标准输出的流设备
C、标准输入的流设备
D、程序入口