酷代码 AI
菜单
服务商
DeepSeek字节豆包讯飞星火
更多选项

Pascal编程:用n元买m只鸡,求解母鸡、公鸡、小鸡购买数量

```pascal program chicken; var n, m, a, b, c: integer; found: boolean; begin readln(n, m); found := false; for a := 1 to m do for b := 1 to m do begin c := m - a - b; if (c >= 1) and (15 * a + 10 * b + 5 * c = n) then begin writeln('mu:', a, ' gong:', b, ' xiao:', c); found := true; end; end; if not found then writeln('No solution'); end. ``` ######[AI问答 | 151点数解答 | 2026-01-02 18:58:59]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]