搜题
网友您好,请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
提问人:网友wjdq120135 发布时间:2022-01-07
[主观题]

请阅读下面的程序,当用户从键盘输入hello world时,分析程序是否能编绎通过并正确运行,如果不能,说明原因;如果能,请写出运行结果。void main();}

简答题官方参考答案 (由简答题聘请的专业题库老师提供的解答)
查看官方参考答案
更多“请阅读下面的程序,当用户从键盘输入hello world时,分析程序是否能编绎通过并正确运行,如果不能,说明原因;如果能,请写出运行结果。void main();}”相关的问题
第1题
执行下面程序时,若从键盘输入“2”,则程序的运行结果是()#include若输入’d’或’D’的话,结果是什么?main()

{intk;charcp;cp=getchar();

if(cp>=’0’&&cp<='9’)k=cp-‘0’;elseif(cp>=‘a'&&cp<=‘f’)

k=cp-‘a’+10;

elsek=cp-‘A’+10;printf(“%d/n”,k);}

A.2

B.4

C.1

D.10

点击查看答案
第2题
运行下面程序时,若从键盘输入5后回车,则程序的输出结果是(); }
A.7

B.6

C.5

D.4

点击查看答案
第3题
阅读下面的程序,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。已知下面程序的功能是:从键盘任意输入一个年号,判断它是否是闰年。若是闰年,输出“Yes”; 否则输出“No”, 已知符合下列条件之一者是闰年:(1) 能被4整除, 但不能被100整除;

(2)能被400整除。

点击查看答案
第4题

下面程序的功能是比较用户键盘输入的口令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

点击查看答案
第5题

下面程序的功能是比较用户键盘输入的口令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

点击查看答案
第6题

下面程序的功能是比较用户键盘输入的口令userInput与内设的口令password是否相同。若相同,则输出"Correct password! Welcome to the system...",若password <userinput,则输出"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

点击查看答案
第7题

下面程序的功能是比较用户键盘输入的口令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

点击查看答案
第8题
当运行以下程序时,从键盘输入abcdabcdef<CR> cde<CR> (<CR>表示回车),则下面程序的运行结果是【 】。 include<stdio.h> main() { int a;char s[80],t[80]; gets(s);gets(t); a=fun(s,t); printf("a=%d\n",a);} fun(char*p,char*q) { int i; char*p1=p; char*q1; for(i=0;*p!=\0;p++,i++) { p=p1+i; if(*p!=*q)continue; for(q1=q+1,p=p+1;*p!=\0&&*q1!=\0;q1++,p++) if(*p!=*q1) break; if(*q1==\0) return i;} return(-1);}
点击查看答案
第9题

下面程序运行时从键盘上输入:1 2 3↙,其输出结果是( )。 #include <stdio.h> int main() { int a[3][2]={0},(*ptr)[2],i,j; for(i=0;i<2;i++) {ptr="a+i;" scanf("%d",ptr); ptr++; } for(i="0;i&lt;3;i++)" for(j="0;j&lt;2;j++)" printf("%d",a[i][j]); return 0;> A、编译错误信息

B、102000

C、123000

D、102030

点击查看答案
第10题
以下程序的功能是从键盘输入若干学生的成绩,并输出最高成绩和最低成绩,当输入负数时结束。请填空。 include <stdio.h> main() { float x,amax,amin; scanf("%f",&x); amax=x; amin=x; while(【 】) { if(x>amax)amax=x; else if(【 】) amin=x; scanf("%f",&x); } printf("\n amax=%f\n amin=%f\n",amax,amin); }
点击查看答案
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

功能 扣减规则
基础费
(查看答案)
加收费
(AI功能)
文字搜题、查看答案 1/每题 0/每次
语音搜题、查看答案 1/每题 2/每次
单题拍照识别、查看答案 1/每题 2/每次
整页拍照识别、查看答案 1/每题 5/每次

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

- 微信扫码关注简答题 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注简答题 -
请用微信扫码测试
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

简答题
下载APP
关注公众号
TOP