#include <iostream>
#include <string>
using namespace std;
const int MSIZE=100;
struct juankuan
{
string name;
double mon;
};
int main()
{
int num;
(cin>>num).get();
int *c1=new int[num];//存储捐款超过10000的捐款个体
int count1=0;//记录捐款超过10000的个数
int *c2=new int[num];//存储捐款超过10000的捐款个体
int count2=0;
juankuan *newjk=new juankuan[num];
int i=0;
while(i<num)
{
cout<<"Enter the name of patron: ";
getline(cin,newjk[i].name);
cout<<"Enter the money of patron: ";
cin>>newjk[i].mon;
cin.get();
if(newjk[i].mon>10000)
{
c1[count1++]=i+1;
}
else
{
c2[count2++]=i+1;
}
i++;
}
cout<<"Grand Patrons: "<<endl;
int j=0,k;
if(count1==0)
cout<<"none"<<endl;
else
{
while(j<count1)
{
k=c1[j];
cout<<newjk[k-1].name<<":"<<newjk[k-1].mon<<endl;
j++;
}
}
int n=0,m;
cout<<"Partons: "<<endl;
if(count2==0)
cout<<"none"<<endl;
else
{
while(n<count2)
{
m=c2[n];
cout<<newjk[m-1].name<<":"<<newjk[m-1].mon<<endl;
n++;
}
}
delete [] newjk;
delete [] c1;
delete [] c2;
system("pause");
return 0;
}

编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习6的更多相关文章

  1. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习9

    #include <iostream> #include <fstream> #include <cstdlib> #include <string> ...

  2. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习8

    #include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using ...

  3. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习7

    #include <iostream> #include <string> #include <cctype> using namespace std; int m ...

  4. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5

    #include <iostream> using namespace std; const double N1=35000; const int N2=15000; const int ...

  5. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习4

    #include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showm ...

  6. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习3

    #include <iostream> using namespace std; void showmenu(void) { cout<<"Please enter ...

  7. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习2

    #include <iostream> #include <cctype> using namespace std; const int MAXSIZE=10; int mai ...

  8. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习1

    #include <iostream>#include <cctype>using namespace std;int main(){ char ch; while((ch=c ...

  9. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习9

    #include <iostream>using namespace std;int main(){ int num; cout<<"Enter number of ...

随机推荐

  1. DC综合简单总结(2)

    DC综合简单总结(2) 建立时间和保持时间和数据输出延时时间 一.概念 建立时间和保持时间都是针对触发器的特性说的. 建立时间(Tsu:set up time) 是指在触发器的时钟信号上升沿到来以前, ...

  2. 2018-2019-2 网络对抗技术 20165325 Exp1 PC平台逆向破解

    2018-2019-2 网络对抗技术 20165325 Exp1 PC平台逆向破解(BOF实验) 实验有三个模块: (一)直接修改程序机器指令,改变程序执行流程: (二)通过构造输入参数,造成BOF攻 ...

  3. JavaScript 变量声明:var、let、const

    1. 概述 1.1 说明 在ES5 声明变量的方法:var命令和function命令. 在ES6 声明变量的方法:var命令.function命令.let命令.const命令.import命令.cla ...

  4. 在Vue中使用样式

    ##使用class样式 一共四种方式在注释中有解释 <!DOCTYPE html> <html> <head> <meta charset="utf ...

  5. web.xml中DispatcherServlet拦截器的配置详情

    <welcome-file-list>    <welcome-file>index.jsp</welcome-file>    <welcome-file& ...

  6. C#多条件查出来的多个DataSet,然后循环将数据整合

    private List<string> barList;        public List<string> BarList        {            get ...

  7. PDF怎么添加文字水印与图片水印

    现在是个知识分享时代,但不可避免的盗版也无处不在,不知道在我们大家身边有没有遇到过这样的情况:自己煞费苦心制作的PDF文档不知道在什么时候就会被别人给盗用了,那么如何才能尽量避免这个问题呢?今天带大家 ...

  8. 小程序+node+mysql做的小项目

    git源码地址: https://github.com/songkangle/weixin_node 小程序页面 数据库 user表 dream表 node的express框架index.js var ...

  9. 下拉框、下拉控件之Select2。自动补全的使用

    参考链接: 参考一:https://blog.csdn.net/weixin_36146275/article/details/79336158 参考二:https://www.cnblogs.com ...

  10. Linq to Object原理

    using System; using System.Collections.Generic; using System.Linq; using System.Threading; namespace ...