#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. UOJ #450「集训队作业2018」复读机

    UOJ #450 题意 有$ k$台复读机,每时每刻有且只有一台复读机进行复读 求$ n$时刻后每台复读机的复读次数都是$ d$的倍数的方案数 $ 1\leq d \leq 3,k \leq 5·10 ...

  2. 417 事件、监听、jQuery、轮播手动

    am:通用事件 a链接事件阻止默认行为 return false HTML元素大都包含了自己的默认行为,例如:超链接.提交按钮等.我们可以通过在绑定事件中加上return false来阻止它的默认行为 ...

  3. C#创建控制台项目引用Topshelf的方式,部署windows服务。

    上一篇是直接创建windows service服务来处理需求.调试可能会麻烦一点.把里面的逻辑写好了.然后受大神指点,用Topshelf会更好一些. 来公司面试的时候问我,为什么要用stringbui ...

  4. oracle参数MEMORY_TARGET太小无法启动的解决过程

    环境: windows server datacenter 4G,4x2=8处理器 oracle 11g 错误如下 ORA-: Specified value of MEMORY_TARGET is ...

  5. JAVA学习笔记(3)—— 抽象类与接口

    1. Java 抽象类 在面向对象的概念中,所有的对象都是通过类来描绘的,但是反过来,并不是所有的类都是用来描绘对象的,如果一个类中没有包含足够的信息来描绘一个具体的对象,这样的类就是抽象类. 抽象类 ...

  6. java学习笔记10-方法

    我们经常用到System.out.println(),它到底是什么? System是系统类 out是系统类的标准输出对象 println()是一个方法 也就是说是调用了System类中的标准输出对象o ...

  7. 看我如何粘贴别人代码--socketserver

    源码执行流程 自己模仿一个(提取代码) 服务器类 import socket import threading import selectors class TCPServer: def __init ...

  8. iOS cocoapods 速度过慢问题

    这个问题真的困扰了很久,虽然我也开了shadowsocks,但是我不知道git命令默认是不走shadowsocks的,所以速度慢的很. 今天拜读了 https://blog.csdn.net/wuqu ...

  9. GDOI2019游记

    只是提前开坑啊,CCF不要禁我赛啊QwQ 虽然才初三,不能进省队,但还是要拼一把,至少不能垫底吧. NTF和CDW两位初二巨佬都在四川省选拿了非正式选手Rank3,4,我还有什么理由去摸鱼? Day\ ...

  10. unity 屏幕适配的问题

    首先是AB的加载时,会出现localscale的改变,需要在初始化时将其调节为1.0并且 offmax和min都设置为0,此时方才会出现在自己臆想之中(尤其是需要设置父节点时)