有以下程序 main() { int k=5,n=0; do { switch(k) { case 1: case 3:n+=1;k--;break; default:n=0;k--; case 2: case 4:n+=2;k--;break; } printf('%d',n); }while(k>0&&n<5); } 程序运行后的输出结果是
A.
235
B.
235
C.
2356
D.
2356
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
皮皮学刷刷变学霸
举一反三
【单选题】Pierre’s friend Henri lives in a town where he has to pay 3 francs per glass of wine and 5 francs per loaf of bread. Henri consumes 5 glasses of wine and 4 loaves of bread per day. Bob has an income o...
A.
Bob and Henri are equally well off
B.
Henri is better off than Bob
C.
Bob is better off than Henri
D.
both of them violate the weak axiom of revealed preferences
【单选题】题目:利用递归函数调用方式,将所输入的 5 个字符,以相反顺序打印出来。 def output(s,l): if l == 0: return print (s[l-1]) output(______) s = input('Input a string:') l = len(s) output(s,l)