第十七周-(项目三)数组的排序。

来源:互联网 发布:温湿度软件 编辑:程序博客网 时间:2024/06/06 03:24
/*02.* 程序的版权和版本声明部分03.* Copyright (c)2013, 烟台大学计算机学院学生04.* All rightsreserve05.* 文件名称: array.cpp06.* 作    者:  王洪海07.* 完成日期:  2013年 12月 21日08.* 版本号: v1.009.* 输入描述:无10.* 问题描述:*/#include <iostream>using namespace std;int main(){   double x,y,z,n=0;   cout<<"百钱百鸡的方案有:"<<endl;   for(x=0;x<=20;x++)     for(y=0;y<=33;y++)       for(z=0;z<=300;z++)         if(5*x+3*y+(z/3)==100&&x+y+z==100)         {             ++n;             cout<<"("<<n<<")"<<". ";             cout<<x<<"  "<<y<<"  "<<z<<endl;         }    return 0;}

运行结果,如图:


0 0
原创粉丝点击