更多"下列程序执行时,从键盘上依次输入123和234,则程序的输出结果是 【"的相关试题:
[填空题]下列程序执行时,从键盘上依次输入123和234,则程序的输出结果是 【10】 。
Dim a,b As Integer
a=InputBox("请输入第一个整数")
b=InputBox("请输入第二整数")
Print a+b
[填空题]从键盘上输入XXYYZZXYZWXP和X,以下程序的输出结果是 [9] 。
#include<iostream.h>
#include<string.h>
void main( ){
char*str,ch;
int count=0,pos;
cin>>str>>ch;
pos=strlen(str)-1;
while(pos>=0){
if((str[pos])=ch)count++;
pos--;
}
cout<<"count="<<count;
}
[填空题]从键盘上输入XXYYZZXYZWXP和X,以下程序的输出结果是 [9] 。
#include<iostream.h>
#include<string.h>
void main( )
char*str,ch;
int count=0,pos;
cin>>str>>ch;
pos=strlen(str)-1;
while(pos>=0)
if((str[pos])=ch)count++;
pos--;
cout<<"count="<<count;
[单项选择]若执行下面的程序时,从键盘上输入5和2,则输出结果是
#include<iostream.h>
void main( )
int a,b,k;
cin>> a >> b;
k=a;
if(a<b)
k=a%b;
else
k=b%a;
cout<< k <<endl;
A. 5
B. 3
C. 2
D. 0
[单项选择]若执行下列的程序时,从键盘上输入1和2,则输出结果是( )。
#include<stdio.h>
main( )
int a,b,s;
scanf("%d%d",&a,&B) ;
S=a;
if(a<B) s=b;
s=s*s;
printtf("%d/n",s);
A. 1
B. 4
C. 2
D. 9
[单项选择]两次运行下面的程序,如果从键盘上分别输入3和2,则输出结果是()。
#include<stdio.h>
main( )
int x;
scanf("%d",&x);
if(x++>2)printf("%d",x);
else printf("%d/n",x--);
A. 4和3
B. 4和2
C. 4和1
D. 3和2
[单项选择]若执行下列的程序时,从键盘上输入1和2,则输出结果是( )。
#include<stdio.h>
main( )
int a,b,s;
scanf("%d%d",&a,&b);
s=a;
if(a<b) s=b;
s=s*s;
printf("%d/n",s);
A. 1
B. 4
C. 2
D. 9
[填空题]用于输出表达式值的标准输出流对象是 【1】 ,用于从键盘上为变量输入值的标准输入流对象是 【2】 。
[单项选择]若运行时从键盘上输入2.0<CR>(<CR>表示回车),则该程序的输出结果是( )
A. 0.000000
B. 0.250000
C. 0.500000
D. 1.000000
[单项选择]两次执行下面的程序,如果从键盘上分别输入4和2,则输出结果是______。
main( )
int x;
scanf("%d/n",&x);
if(x++>3)printf("%d/n",x);
else printf("%d/n",x--);
A. 7和5
B. 5和3
C. 7和4
D. 6和4
[单项选择]两次执行下面的程序,分别从键盘上输入6和4,则输出结果是______。
main( )
int x;
scanf("%d",&x);
if(x++>5)
printf("%d",x);
else
printf("%d",x--);
A. 7 4
B. 6 3
C. 7 5
D. 6 4
[单项选择]
下面的各种设备中, (16) 既是输入设备,又是输出设备。 (17) 组设备依次为输出设备、存储设备、输入设备。 (18) 用于把摄影作品、绘画作品输入到计算机中,进而对这些图像信息进行加工处理、管理、使用、存储和输出。不属于输入设备的是 (19) 。
(16)处填()。
A. 扫描仪
B. 打印机
C. 键盘
D. 键盘
[填空题]从键盘上输入若干个学生成绩,统计并输出最高成绩和最低成绩,当输入负数时结束输入。请填空。
main( )
{float s,gmax,gmin;
scanf("%f,"&s);
gmax=s;gmin=s;
while(s>=0)
{if(s>gmax)gmax=s;
if(______)gmin=s;
scanf("%f",&s);}
printf("gmax=%f/ngmin=%f/n"gmax,gmin);}