C++第四次作业7
来源:互联网 发布:美萍软件使用教程 编辑:程序博客网 时间:2024/06/11 14:20
1百钱百鸡
#include <iostream.h>void main(){int a=0,b=0,c=0;while (5*a+3*b+c/3<=100){c=c+3; if(5*a+3*b+c/3>100) b=b+1, c=0; if(5*a+3*b+c/3>100) a=a+1,b=0, c=0;if((5*a+3*b+c/3==100)&&(a+b+c==100))cout<<a<<" "<<b<<" "<<c<<endl;}}
2 几何
#include <iostream.h> void main() { int a=0,n=0,i=1,b,c; while (n*(n+a)*(n+a+a)*(n+a+a+a)<=880) { n++; if (n*(n+a)*(n+a+a)*(n+a+a+a)>880) n=1, a=a+1; if ((n*(n+a)*(n+a+a)*(n+a+a+a)==880)&&(4*n+6*a==26)) b=a,qc=n; } while (i<=20) { i++; cout<<c<<endl; c=c+b; }
3 球
#include <iostream.h> void main() { int a=0,n=0,c; while (a<4&&n<4&&c<7) { n++; if (n>3) if (a<3) a=a+1,n=0; c=8-a-n; if (c>6) c=0; else if(n<4) cout<<"红球:"<<a<<"白球:"<<n<<"黑球:"<<c<<endl; } }
0 0
- C ++第四次作业
- 第四次作业 作业7
- C语言第四次作业
- C语言第四次作业
- C++第四次作业7
- 第四次C程序课堂作业
- C语言第四次作业练习
- 第四次作业
- 第四次作业
- 第四次作业
- 第四次作业
- 第四次作业
- 第四次作业
- 第四次作业
- 第四次作业哦~~~~
- 第四次作业
- 第四次作业
- 第四次作业
- Spring获取request和response
- 网际协议IP(3)之网际控制报文协议ICMP(Internet Control Message Protocol)
- HDOJ--1282 回文数猜想
- Aprior c++ 实现
- mysql(一)
- C++第四次作业7
- CSS背景图片
- java 中 Cannot make a static reference to the non-static 解决方法
- 找出指定网络内能连通外网的ip
- 使用Python通过win32 COM实现Word文档的写入与保存
- PAT 1008 Elevator(水题)
- 友盟微信登录只走onstart方法
- MySQL 高可用性之 Keepalived 双主热备
- [经典] IOC/DI与AOP概念的理解