#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. hibernate批量删除写法

    1.批量删除正常写法,此方式在海量数据删除时可能有效率问题 private static final String DELETE_USER_NAME= "DELETE FROM User x ...

  2. 解决 win10 新建文件夹重命名卡死的另一种方法

    遇到 win10 新建文件夹重命名卡死时 根据网上的各种方法都不起作用时可以试一下这个方法. 文件夹属性 --- 自定义 --- 你想要那种文件夹 优化此文件夹 --- 把 [视频] 改成 [常规项目 ...

  3. HDU-魔咒词典(字符串hash)

    魔咒词典 TimeLimit: 8000/5000 MS (Java/Others)  MemoryLimit: 32768/32768 K (Java/Others) 64-bit integer ...

  4. python获取设备主机名和IP地址

    import socket def print_machine_info(): host_name = socket.gethostname() ip_address = socket.gethost ...

  5. C++入门篇十三

    常对象: const  Person p1; 不可以调用普通成员函数,除非前面加了函数前面加了const可以调用常函数在对象之前加入const修饰 const Person p1; 常函数:void ...

  6. 解释内存中的栈(stack)、堆(heap)和静态区(static area)的用法

    堆区:专门用来保存对象的实例(new 创建的对象和数组),实际上也只是保存对象实例的属性值,属性的类型和对象本身的类型标记等,并不保存对象的方法(方法是指令,保存在Stack中) 1.存储的全部是对象 ...

  7. SignalR在Asp.NetCore中的使用

    SignalR简介 ASP.NET SignalR是为ASP.NET 开发人员提供的一个库,旨在为你的Web应用迅速简便的添加实时通信功能.这个Web通信功能是指:客户端可以实时从服务端代码拉取数据, ...

  8. 2、阿里云ECS发送邮件到腾讯企业邮箱(ECS默认不开启25端口)

    阿里云ECS默认禁用25端口导致发邮件失败. 方法一: 使用shell脚本发送邮件,需要配置mailx 1.安装软件 yum install mailx 2.配置 vim /etc/mail.rc在文 ...

  9. mac上安装vue项目

    mac上如何安装vue项目 一, mac系统安装brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/H ...

  10. C++中的继承(2)类的默认成员

    在继承关系里面, 在派生类中如果没有显示定义这六个成员函数, 编译系统则会默认合成这六个默认的成员函数. 1.构造与析构函数的调用关系 调用关系先看一段代码: class Base { public ...