#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. 安装hue及hadoop和hive整合

    环境: centos7 jdk1.8.0_111 Hadoop 2.7.3 Hive1.2.2 hue-3.10.0 Hue安装: 1.下载hue-3.10.0.tgz: https://dl.dro ...

  2. 传输层--TCP和UDP的区别

    UDP(用户数据报协议):为调用它的应用程序提供了一种不可靠.无连接的服务. TCP(传输控制协议):为调用它的应用程序提供了一种可靠的.面向连接的服务. 当设计一个网络应用程序时,该应用程序的开发人 ...

  3. shiroUtil工具类

    package com.chabansheng.util; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.A ...

  4. ASP.NET Core 项目配置 ( Startup )(转载)

    原文:https://www.twle.cn/l/yufei/aspnetcore/dotnet-aspnet-startup.html 由于是个人网站,怕没了,特意复制保存,个人觉得讲的非常透彻 前 ...

  5. springboo+nginx测试反向代理02

    本节对nginx配置方面会略微研究~~ 1:切换到 /opt/nginx-1.8.1/conf 目录,将nginx.conf文件拷贝到 /myprojects/nginx 目录下 2:切换到/opt/ ...

  6. div上下左右居中

    链接.father { width: 300px; height:150px; position: relative; } .son { position: absolute; top: 0; rig ...

  7. python正则表达式--分组、后向引用、前(后)向断言

    无名.有名分组 (1)正则表达式—无名分组 从正则表 达式的左边开始看,看到的第一个左括号“(”表示表示第一个分组,第二个表示第二个分组, 依次类推. 需要注意的是,有一个隐含的全局分组(就是索引号为 ...

  8. 学习 razor pages 指南

    这是一个系列,我打算把此人的系列翻译一下,学习技术的同时,顺便提高一下英文水平. 原文地址:https://www.learnrazorpages.com/ 前言 欢迎来学习 razor pages ...

  9. 如何kill掉tomcat服务

    一般我们使用tomcat使用的都是8080端口,今天我在使用eclipse的时候连续启动了两次tomcat,发现被占用了. 第一想法便是重启eclipse,重启后发现tomcat的8080仍然是已经被 ...

  10. 小米平板4 Plus获取Root超级权限的步骤

    小米平板4 Plus有么好方法开启Root权限?大家都清楚,Android机器有Root权限,一旦手机开启root相关权限,就可以实现更强大的功能,打比方大家部门的营销部门的同事,使用个别营销应用都需 ...