更多"有如下程序: INPUT TO A IF A=10 S=0 E"的相关试题:
[单项选择]有如下程序:
INPUT TO A
IF A=10
S=0
ENDIF
S=I
S
假定从键盘输入的A的值一定是数值型,那么上面条件选择程序的执行结果是______。
A. 0
B. 1
C. 由A的值决定
D. 程序出错
[单项选择]有如下程序: x = InputBox("Input value of x") Select Case x Case Is > 0 y=y+1 Case Is = 0 y=x + 2 Case Else y=x + 3 End Select Print x, y运行时,从键盘输入-5,输出的结果是( )。
A. -5-2
B. -5-4
C. -5-3
D. -5-5
[单项选择]有如下程序:
infocase$=InputBox("Input one letter:")
Select Case infocase$
Case"a"
grade$="Very good"
Case"b"
grade$="good"
Case"c"
grade$="OK"
Case"d"
grade$="Qualified"
Case Else
grade$="Bad"
End Select
Print grade$
运行时从键盘上输入英文小写字母d后,输出的结果是______。
A. Very good
B. Good
C. Bad
D. Qualified
[单项选择]有如下程序:
x=-5
s=InputBox("input value of s:")
Select Case x
Case x
y=x+1
Case Is=0
y=x+2
Case Else
y=x+3
End Select
Print x; y
运行时,从键盘输入-5,输出的结果是______。
A. -5-2
B. -5-4
C. -5-3
D. -5-5
[填空题]有如下一段程序:
INPUT "请输入当前日期:" TO RQ29
RQ29
在执行本程序时,用户应当输入 【19】 ,显示的结果才是:11/28/98。
[填空题]有如下一段程序:
INPUT”请输入当前日期:” T0 RQ
RQ+29
在执行本程序时,用户应当输入 [2] ,显示结果才是:12/27/98。
[简答题]
已知C源程序如下:
/*Input today’s date,output tomorrow’s date * /
/* version 2 * /
#include<stdio. h>
struct ydate
int day; int month; int year;;
int leap(struct ydate d)
if((d. year%4==0&&d. year%100 ! =0)||(d. year%400==0))
return 1;
else
return 0;
int numdays(struct ydate d)
int day;
static int daytab[]=
31,28,31,30,31,30,3l,31,30,31,30,31;
if(1eap(d)&&d. month==2)
day=29;
else
day=daytabEd. month-1];
return day;
int main(void)
struct ydate today,tomorrow;printf("format of date is:year,month,day输入的年、月、日之间应用逗号隔开/n);
printf(" today is:");
scanf(“%d,%d.%",&today.year,&today.month,&today.day);
while(0>=today. year
|| today. year>65535||0>=today. month||today. month>12)||
0>=today. day||today. day>numdays(today))
printf("input date error!reenter the day!/n");<
[简答题]已知C源程序如下:
/*Input today’s date,output tomorrow’s date*/
/*version 2*/
#include<stdio.h>
struct ydate
int day;int month;int year;;
int leap(struct ydate d)
if((d.year%4==0&&d.year%100!=0)||(d.year%400==0))
return 1;
else
return 0;
int numdays(struct ydate d)
int day;
static int daytab[]=
31,28,31,30,31,30,31,31,30,31,30,31);
if(leap(d)&&d.month==2)
day=29;
else
day=daytab[d.month-1];
return day;
int main(void)
struct ydate today,tomorrow;
printf("format of date is:year,month,day 输入的年、月、日之间应用逗号隔开/n");
printf("today is:");
scanf("%d,%d,%d",&today.year,&today.month,&today.day);
while(0>=today.year
|| today.year>65535 || 0>=today.month || today.month>12) ||
0>=today.day || today.day>numdays(today))
printf("input date error!reenter the day!/n");
printf("today is:");
scanf("
[简答题]
已知C源程序如下:
/*Input today’s date,output tomorrow’s date*/
/*version 2*/
#include<stdio.h>
struct ydate
int day;int month;int year;;
int leap(struct ydate d)
if((d.year%4==0&&d.year%100!=0)||(d.year%400==0))
return 1;
else
return 0;
int numdays(struct ydate d)
int day;
static int daytab[]=
31,28,31,30,31,30,31,31,30,31,30,31);
if(leap(d)&&d.month==2)
day=29;
else
day=daytab[d.month-1];
return day;
int main(void)
struct ydate today,tomorrow;
printf("format of date is:year,month,day 输入的年、月、日之间应用逗号隔开/n");
printf("today is:");
scanf("%d,%d,%d",&today.year,&today.month,&today.day);
while(0>=today.year
|| today.year>65535 || 0>=today.month || today.mon
[单项选择]有以下程序:
INPUTTO A
S=0
IF A=10
S=1
ENDIF
S=2
S
假定从键盘输入的A值是数值型,则程序的运行结果是______。
A. 0
B. 1
C. 2
D. 1或2
[简答题]如下程序是为变量i赋值。若程序的输出结果是180。请将程序补充完整。
注意:不改动程序结构,不得增行或删行。
class Base
{
int i;
Base( )
{
add(10);
}
void add(int v)
{
i+=v;
}
void print( )
{
System.out.println(i);
}
}
class Extension extends Base
{
Extension( )
{
add(______);
}
void add(int v)
{
i+=v*2;
}
}
public class ConstructTest3
{
public static void main(String args[])
{
bogo(new Extension( ));
}
static void bogo(Base b)
{
b.add(60);
b.print( );
}
}
[单项选择]有如下程序:
#include
usingnamespacestd;
classB{
public:
virtualvoidshow(){cout<<"B";}};
classD://publicB{
public:
voidshow(){cout<<"D";}
};
voidfun1(B*ptr){ptr->show();
}voidfun2(B&ref){ref.show();
}voidfun3(BB){b.show();
}
intmain(){
Bb,*p=newD;
Dd;
funl(p);
fun2(b);
fun3(d);
return0;
}
程序的输出结果是( )。
A. BBB
B. BBD
C. DBB
D. DBD