在下列程序中,如果要使程序继续循环,变量M的输入值应为______。DOWHILE.T.WAIT"M="TOMIFUPPER(M)$"YN"EXITENDIFENDDO
A.Y或y
B.N或n
C.Y、y或者N、n
D.Y、y、N、n之外的任意字符
- · 有3位网友选择 B,占比30%
- · 有3位网友选择 A,占比30%
- · 有2位网友选择 C,占比20%
- · 有2位网友选择 D,占比20%
A.Y或y
B.N或n
C.Y、y或者N、n
D.Y、y、N、n之外的任意字符
若想从键盘上输入数据,使变量m中的值为123,n中的值为456,P中的值为789,则正确的输入是( )。
A)m=123n=456p=789
B)m=123 n=456 p=789
C)m=123,n=456,p=789
D)123 456 789
下面程序的功能是比较用户键盘输入的口令userInput与内设的口令password是否相同。若相同,则输出"Correct password! Welcome to the system...",若userInput <password,则输出"invalid password!user input> password"。 按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 #include <stdio.h> #include <string.h> int main() { char password[7] = "secret"; char userInput[81] ; printf("Input Password:"); scanf(_____________); if ( ______________ ) printf("Correct password! Welcome to the system...\n"); else if ( ___________________) printf("Invalid password!user input <password\n"); else printf("invalid password!user input> password\n"); return 0; }
A、第8行: "%s", userInput 第9行: strcmp(userInput, password) == 0 第11行: strcmp(userInput, password) < 0
B、第8行: "%c", userInput 第9行: strcmp(userInput, password) = 0 第11行: strcmp(userInput, password) < 0
C、第8行: "%s", userInput 第9行: userInput==password 第11行: userInput <password>
D、第8行: "%c", userInput 第9行: strcpy(userInput, password) == 0 第11行: strcpy(userInput, password) < 0
A. flag=False
B. flag=Notflag
C. flag=True
D. ExitDo
t=1-1/2+1/3-1/4+…+(-1)(m+1)/m
例如,若输入5,则应输出0.783333。
请改正程序中的错误,使它能得到正确结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
include <conio.h>
include <stdio.h>
/*************found*************/
int fun(int m)
{
double t=1.0,j=1.0;
int i;
/*************found*************/
for(i=l;i<m;i++)
{j=-1*j;t+=j/i;}
return t;
}
main()
{
int m;
clrscr();
printf("\nPlease enter 1 integer number:");
scanf("%d",&m);
printf("/nThe result is%If\n",fun(m));
}
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!