首页 > 大学专科> 土建
题目内容 (请给出正确答案)
[主观题]

请写出下面程序的输出结果。def fun(s,n):If n==1:return Is[0];t=fun(s,n-1)if t<ls[n-1]:retu

请写出下面程序的输出结果。def fun(s,n):If n==1:return Is[0];t=fun(s,n-1)if t<ls[n-1]:retu

请写出下面程序的输出结果。

def fun(s,n):

If n==1:

return Is[0];

t=fun(s,n-1)

if t<ls[n-1]:

return t

else:

return Is[n-1]

print(fun([35,27,29,50-1],5)

print(fun([35,27,29,50-1],3))

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“请写出下面程序的输出结果。def fun(s,n):If n…”相关的问题
第1题
阅读以下程序,填写运行结果()。def fun(a,b,*c): lst=[] for i in c: lst.append(a*b*i) return

阅读以下程序,填写运行结果()。def fun(a,b,*c): lst=[] for i in c: lst.append(a*b*i) return lst print(fun(2,3,4,5,6)[1])

点击查看答案
第2题
阅读下面程序,写出输出结果。#include using namespace std ; class A { int a, b; public :
阅读下面程序,写出输出结果。#include using namespace std ; class A { int a, b; public :

阅读下面程序,写出输出结果。

#include using namespace std ; class A { int a, b; public : A() { a = b = 0; }

A(int aa, int bb) { a = aa; b = bb; cout << a << ' ' << b << endl ; } }; int main() { A x, y(2,3);

return 0; }

点击查看答案
第3题
写出以下程序的运行结果。#include int fun(int a){int b=0;static int c=3;b ; c ;return(a
写出以下程序的运行结果。#include int fun(int a){int b=0;static int c=3;b ; c ;return(a

写出以下程序的运行结果。

#include int fun(int a){int b=0;static int c=3;b ; c ;return(a b c);}

main(){int i, a=5;for (i=0; i<3; i )cout<< i<< " "<< fun(a)<< " ";}

点击查看答案
第4题
运行以下程序,输出结果为()。lst1=['abc','def','ghi'] lst2=[i[::-1
] for i in lst1] print(lst2[1][2])

点击查看答案
第5题
写出下面程序的输出结果()#includeint main(){int x=6,y,z;x*=18+1;printf("%d,",x--);x+=y=z=11;printf("%d",x);return 0;}

A.114,124

B.109,116

C.113,124

D.110,116

点击查看答案
第6题
阅读下面程序段,则执行后输出的结果是()。 include“stdio.h” void main() { char fun

阅读下面程序段,则执行后输出的结果是()。 include“stdio.h” void main() { char fun(char,int); char a;‘A’; int b=13; a=fun(a,b); putchar(a); ) char fun(char a,int b) { char k; k=a+b; return k; )

A.A

B.M

C.N

D.L

点击查看答案
第7题
下面程序执行后输出的结果是【 】。 int m=13; int fun(int x,int y) { int m

下面程序执行后输出的结果是【 】。 int m=13; int fun(int x,int y) { int m=3; return(x*y-m); } main() { int a=7,b=5; Printf(“%d\n",fun(a,b)/m); }

点击查看答案
第8题
阅读下列程序,则程序的输出结果为【 】。 include"stdio.h" struct ty {
int data; char c;}; main() { struct ty a={30,x}; fun(a); printf("%d%c",a.data,a.c);} fun(struct ty b) { b.data=20; b.c=y;}

点击查看答案
第9题
阅读下列程序,则程序的输出结果为______。 include "stdio.h" struet ty { int data;
char c;}; main() { street ty a={30,x}; fun(a); printf("%d%c",a.data,a.c);} fun(struct ty b) { b.data=20; b.c=y;}

点击查看答案
第10题
阅读下面程序,则程序的执行结果为【 】。 include"stdio.h" fun(int k,int*p) { int

阅读下面程序,则程序的执行结果为【 】。 include"stdio.h" fun(int k,int*p) { int a,b; if(k==1‖k==2) *p=1; else{ fun(k-1,&a); fun(k-2,&b); *p=a+b; } } main() { int x; fun(6,&x); printf("%d\n",x);}

点击查看答案
第11题
阅读下面程序,则程序的执行结果为【 】。 include"stdio.h" main() { int

阅读下面程序,则程序的执行结果为【 】。 include"stdio.h" main() { int a=30,b=20,z; z=fun(a+b,a-b); printf("%d\n",z);} fun(int a,int b) { int z; z=a/b; return z;}

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改