问题
问答题
已知笼中有鸡和兔共36只,它们的脚共有100只,编程计算鸡和兔分别有多少只。
答案
参考答案:
set talk off clear for i=A to CF for j=A to CF if i+j=CF.and.i*B+j*D=A00 "鸡的只数",i "兔的只数",j endif next next cancel set talk on
已知笼中有鸡和兔共36只,它们的脚共有100只,编程计算鸡和兔分别有多少只。
参考答案:
set talk off clear for i=A to CF for j=A to CF if i+j=CF.and.i*B+j*D=A00 "鸡的只数",i "兔的只数",j endif next next cancel set talk on