用VFP编写程序,用100元买100只鸡,公鸡5元,母鸡3元,小鸡0.3元,问各买多少只公鸡、母鸡、小鸡?
答案:1 悬赏:80 手机版
解决时间 2021-06-07 05:39
- 提问者网友:玫瑰园
- 2021-06-06 16:21
用循环、分支结构,简单点最好。用VFP编写程序不用C语言,DO While、或for编写 谢谢咯
最佳答案
- 五星知识达人网友:酒醒三更
- 2021-06-06 17:37
CLEAR
FOR a = 1 to 20
FOR b = 1 to 33
c = 100-a-b
IF a*5+b*3+c/3 = 100 THEN
?"公鸡",a,"只","母鸡",b,"只","小鸡",c,"只"
ENDIF
ENDFOR
ENDFOR
FOR a = 1 to 20
FOR b = 1 to 33
c = 100-a-b
IF a*5+b*3+c/3 = 100 THEN
?"公鸡",a,"只","母鸡",b,"只","小鸡",c,"只"
ENDIF
ENDFOR
ENDFOR
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯