11,19,19
12,20,20
11,20,20
12,19,20
第1题:
有以下程序:
include”iostream.h”
void main()
{int i=10;
int j=5;
cout((j+i++<<endl;}
的结果为______。
第2题:
有以下程序:
include <iostream>
using namespace std;
int main()
{
int i=010,j=10;
cout<<(++i)<<","<<i--<<end1;
return 0;
}
则该程序运行后的输出结果是【 】。
第3题:
有以下程序: #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
第4题:
有以下程序: #include <iostream> using namespace std; int main () { int n; cin>>n; if (n++<10) cout<<n<<end1; else cout<<n--<<end1; return 0; } 若执行该程序时从键盘上输入9,则输出结果是( )。
A.11
B.10
C.9
D.8
第5题:
有以下程序:#include <stdio.h>main( ){ int a=1,b; for(b =1;b <=10;b++) { if(a> =8) break; if(a%2 == 1) {a + =5;continue;} a- =3; printf( "% d \n" ,b);}程序运行后的输出结果( )。
A.3
B.4
C.5
D.6
第6题:
有以下程序#include <stdio.h>#include <stdlib.h>int fun(int t){ int *p; p=(int*)malloc(sizeof(int)); *p=t; return *p;}main(){ int a; a = fun(8); printf("%d\n", a+fun(10));}程序的运行结果是A.0 B.10 C.18 D.出错
第7题:
有以下程序 #include <stdio.h> #include <stdlib.h> int fun(int n) {int *p; p=(int*)malloc(sizeof(int)); *p=n; return *p; } { int a; a=fun(10); printf("%d\n",a+fun(10)); } 程序的运行结果是______。
A.0
B.10
C.20
D.出错
第8题:
有以下程序:
include <fstream>
include <string>
using namespace std;
int main ()
{
char ch[] = "The end";
ofstream outstr( "d:\\put.txt", ios_base: :app);
for (int i = 0; i < strlen( ch ); i++ )
outstr.put(ch[i]);
outstr.close();
return 0;
}
程序实现的功能是【 】。
第9题:
有以下程序: #include <iostream> #include <fstream> using namespace std; int main ( ) { ofstream ofile; char ch; ofile.open ("abc.txt"); cin>>ch; while (ch!='#' ) { cin>>ch; ofile.put(ch);
A.程序编译时出错
B.abc#
C.abc
D.#
第10题:
有以下程序,程序执行后,输出结果是【 】
include<stdio.h>
void fun(int*A)
{ a[0]=a[1];}
main()
{ int a[10]={10,9,8,7,6,5,4,3,2,1,},i;
for(i=2;i>1=0;i-) fun(&a[i]);
for(i=0;i<10;i++) printf("%d,a[i]);
printf("\n");
}
第11题:
有以下程序:
include<iostream>
using namespace std;
int main()
{
int i=1,sum=0;
Loop:if(i<=20)
{
sum+=i;
i++;
goto Loop;
}
cout<<sum<<end1;
return 0;
}
该程序运行后的输出结果是【 】。
第12题:
有以下程序: #include<iostream> using namespace std; int main() { char a[10] = {'1','2','3','4','5','6','7','8','9','0'),*p; int i=8; p=a+i; cout<<p-3<<end1; return 0; } 执行程序后的输出结果是( )。
A.6
B.6789
C.'6'
D.789
第13题:
有以下程序:
include <iostream>
using namespace std;
int f(int);
int main()
{
int i;
for(i=0;i<5;i++)
cout<<f(i)<<" ";
return 0;
}
int f(int i)
{
static int k=1;
for(;i>0;i--)
k+=i;
第14题:
以下程序段给数组A的所有元素输入数据,请填空。
include<iostream. h>
void main () {
int a[10], i;
i=0;
while (i<10) cin>> 【 】
}
第15题:
有以下程序: #include <stdio. h> main( ) { unsigned int a; int b=-1; a=b; printf(" % u", a);程序运行后的输出结果是( )。
A.-1
B.65535
C.32767
D.-32768
第16题:
有以下程序: #include<iostream> using namespace std; int a; int fun(); int main() { externint a; int b; a=10; b=fun(); cout<<b<<end1; return 0; } int fun() { extern int a; return(10*a); } 其程序运行后的输出结果是( )。
A.10
B.1
C.100
D.1000
第17题:
有以下程序: #include <stdio.h> int a=2; int f(int *a) { return (*a) ++;} main() { int s=0; { int a=5; s+=f(&a); } s+=f(&a); printf("%d\n",s) } 执行后的输出结果是( )。
A.10
B.9
C.7
D.8
第18题:
有以下程序,其输出结果是( )。 #include <iostream> using namespace std; int main(){ char a[10]={'1','2','3','4','5','6','7','8','9',0},*p; int i=8; p=a+i; cout<<p-3<<endl; return 0; }
A.6789
B.6
C.789
D.'6'
第19题:
若有以下程序:
include <iostream>
using namespace std;
int main()
{
char str[10];
cin>>str;
cout<< str<<end1;
return 0;
}
当输入为:
This is a program!
那么执行程序后的输出结果是【 】。
第20题:
有以下程序: #include <iostream> using namespace std; int main() { int x; for(int i=1;i<=100;i++) { x=i; if (++x%2==0) if (++x%3==0) if (++x%7==0) cout<
A.39,81
B.42,84
C.26,68
D.28,70
第21题:
有以下程序 #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
第22题:
有以下程序#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
第23题:
有以下程序: #include <iostream> using namespace std; int main() { int intone; int &rInt=intone; intone=5; rInt=7; cout<<intOne<<","<<rInt<<end1; return 0; } 上述程序执行后的输出结果是( )。
A.5,7
B.7,5
C.5,5
D.7,7
第24题:
有以下程序: #include <stdio.h> main( ) { int a,b,d =25; a = d/10%9;b = a&&(-1); printf("% d,% d\n" ,a,b); } 程序运行后的输出结果是( )。
A.6,1
B.2,1
C.6,0
D.2,0