题目内容 (请给出正确答案)
[主观题]

阅读下面的程序,按要求在空白处填写适当的表达式或语句,使程序 完整并符合题目要求,然后上机运行程序,写出程序的运行结果。 ()

提问人:网友lingmu 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“阅读下面的程序,按要求在空白处填写适当的表达式或语句,使程序…”相关的问题
第1题
阅读下面的程序,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。已知下面程序的功能是:从键盘任意输入一个年号,判断它是否是闰年。若是闰年,输出“Yes”; 否则输出“No”, 已知符合下列条件之一者是闰年:(1) 能被4整除, 但不能被100整除;

(2)能被400整除。

点击查看答案
第2题
以下程序用来完成数学函数P(x, y)的计算,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 #include <math.h> #include <stdio.h> double F(double a); int main() { double x, y, p; scanf("%lf%lf", &x, &y); p = x * y / F(______________); printf("result=%lf\n", p); return 0; } double F(double a) { double f1; f1 = pow(4, a) + sqrt(10 +_____________); return f1; }

A、第8行: x+2*y 第17行: pow(3,2*a)

B、第8行: x+2y 第17行: pow(3,2a)

C、第8行: sqrt(x+2*y) 第17行: sqrt(pow(3,2*a))

D、第8行: sqrt(x+2y) 第17行: sqrt(pow(3,2a))

点击查看答案
第3题

下面程序的功能是实现字符串逆序存放。 程序运行结果如下: Input a string:ABCDEFGHI↙ Inversed results:IHGFEDCBA 按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 #include <stdio.h> #include <string.h> #define N 80 void Inverse(char *pStr); int main() { char a[N]; printf("Input a string:"); gets(a); Inverse(a); printf("Inversed results:%s\n", a); return 0; } /* 函数功能: 实现将字符数组中的字符串逆序存放 */ void Inverse(____________) { int len; char temp; char *pStart; /* 指针变量pStart指向字符串的第一个字符 */ char *pEnd; /* 指针变量pEnd指向字符串的最后一个字符 */ len = strlen(pStr); /* 求出字符串长度 */ for (pStart=pStr,___________; pStart <pend; pstart++,__________) { temp="*pStart;" ______________; *pend="temp;" }> A、第16行: char *pStr 第23行: pEnd=pStr+len-1 pEnd-- 第26行: *pStart = *pEnd

B、第16行: char pStr 第23行: pEnd=pStr+len pEnd-- 第26行: *pStart = *pEnd

C、第16行: char *pStr 第23行: pEnd=pStr+len-1 pEnd++ 第26行: pStart = pEnd

D、第16行: char pStr 第23行: pEnd=pStr+len+1 pEnd++ 第26行: *pStart = *pEnd

点击查看答案
第4题

下面程序的功能是利用泰勒级数计算sinx的值,要求最后一项的绝对值小于,并统计出此时累加了多少项。按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include <math.h> #include <stdio.h> int main() { int n = 1, count = 1; double e = 1.0, term = 1.0; long fac = 1; for (n=1; ___________; n++) { fac = ________; term = _________; ________________; count++; } printf("e = %f, count = %d\n", e, count); return 0; }

A、第8行: fabs(term)>=1e-5 第10行: fac * n 第11行: 1.0 / fac 第12行: e = e + term

B、第8行: fabs(term)<1e-5 第10行: fac * n 第11行: 1.0 第12行: e="e" term> C、第8行: fabs(term)>1e-5 第10行: fac / n 第11行: 1 / fac 第12行: e = e + term

D、第8行: fabs(term)<=1e-5 1 第10行: fac + n 第11行: 第12行: term="e">

点击查看答案
第5题

下面程序的功能是利用泰勒级数计算sinx的值,要求最后一项的绝对值小于,并统计出此时累加了多少项。按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include <math.h> #include <stdio.h> int main() { int n = 1, count = 1; double e = 1.0, term = 1.0; long fac = 1; for (n=1; ___________; n++) { fac = ________; term = _________; ________________; count++; } printf("e = %f, count = %d\n", e, count); return 0; }

A、第8行: fabs(term)>=1e-5 第10行: fac * n 第11行: 1.0 / fac 第12行: e = e + term

B、第8行: fabs(term)<1e-5 第10行: fac * n 第11行: 1.0 第12行: e="e" term> C、第8行: fabs(term)>1e-5 第10行: fac / n 第11行: 1 / fac 第12行: e = e + term

D、第8行: fabs(term)<=1e-5 1 第10行: fac + n 第11行: 第12行: term="e">

点击查看答案
第6题

以下程序用来完成数学函数P(x, y)的计算,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include <math.h> #include <stdio.h> double F(double a); int main() { double x, y, p; scanf("%lf%lf", &x, &y); p = x * y / F(______________); printf("result=%lf\n", p); return 0; } double F(double a) { double f1; f1 = pow(4, a) + sqrt(10 +_____________); return f1; }

A、第8行: x+2*y 第17行: pow(3,2*a)

B、第8行: x+2y 第17行: pow(3,2a)

C、第8行: sqrt(x+2*y) 第17行: sqrt(pow(3,2*a))

D、第8行: sqrt(x+2y) 第17行: sqrt(pow(3,2a))

点击查看答案
第7题

以下程序用来完成数学函数P(x, y)的计算,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include <math.h> #include <stdio.h> double F(double a); int main() { double x, y, p; scanf("%lf%lf", &x, &y); p = x * y / F(______________); printf("result=%lf\n", p); return 0; } double F(double a) { double f1; f1 = pow(4, a) + sqrt(10 +_____________); return f1; }

A、第8行: x+2*y 第17行: pow(3,2*a)

B、第8行: x+2y 第17行: pow(3,2a)

C、第8行: sqrt(x+2*y) 第17行: sqrt(pow(3,2*a))

D、第8行: sqrt(x+2y) 第17行: sqrt(pow(3,2a))

点击查看答案
第8题

以下程序用来完成数学函数P(x, y)的计算,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include <math.h> #include <stdio.h> double F(double a); int main() { double x, y, p; scanf("%lf%lf", &x, &y); p = x * y / F(______________); printf("result=%lf\n", p); return 0; } double F(double a) { double f1; f1 = pow(4, a) + sqrt(10 +_____________); return f1; }

A、第8行: x+2*y 第17行: pow(3,2*a)

B、第8行: x+2y 第17行: pow(3,2a)

C、第8行: sqrt(x+2*y) 第17行: sqrt(pow(3,2*a))

D、第8行: sqrt(x+2y) 第17行: sqrt(pow(3,2a))

点击查看答案
第9题

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

点击查看答案
第10题

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

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

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

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

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

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信