其他语言

本类阅读TOP10

·基于Solaris 开发环境的整体构思
·使用AutoMake轻松生成Makefile
·BCB数据库图像保存技术
·GNU中的Makefile
·射频芯片nRF401天线设计的分析
·iframe 的自适应高度
·BCB之Socket通信
·软件企业如何实施CMM
·入门系列--OpenGL最简单的入门
·WIN95中日志钩子(JournalRecord Hook)的使用

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
初学时候的记忆(1)5/24/04 1:28AM

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

#include <iostream>
using namespace std;

struct stu{
 char a[20];
 double k;
 };

main()
{
  int r,i,w,u;
  w = 0,u = 0;
  cout <<"Please the importation number:\n";//输入捐款人数
  cin >> i;
  stu* ps = new stu[i];
  for(r = 0;r < i;r++)
   {
     cout << "name:\n";
     cin.get();       
     cin.get((*ps).a,20); //输入捐款人名字  
     cout << "money:\n";
     cin >> (*ps).k;  // 输入捐款人的款数
     ps++;
   }
   ps = ps - i;
   cout << "The importance contributes money the person:\n";//重要捐款人 
   for(r = 0;r < i; r++)
    {
   
      if ((*ps).k > 10000)//如果捐款人款数多于10000那就是重要捐款人
      {
        
         cout << "name:\n";
         cout << (*ps).a << "\n";
         cout << "Number:\n";//款数
         cout << (*ps).k << "\n";
         w++;
         ps=ps + 1;
      }
      ps = ps - w;
     cout << "It is other to contribute money the person:\n";//其他捐款人 
     for(r = 0;r < i; r++)
    
        {
          cout << "name:\n";
          cout << (*ps).a << "\n";
          cout << "Number:\n";//款数
          cout << (*ps).k << "\n";
          u++;
          ps=ps + 1;
        } 
    }   
     if (w == 0)
      {
       cout << "The importance contributes money the person:\n";//如果用户输入没有重要捐款人输出NONE
       cout << "none";
      }
     if (u == 0)
      {
       cout << "It is other to contribute money the person:\n";//如果用户输入没有其它捐款人输出NONE
       cout << "none";    
      }
    int q;
    cin >> q;
   delete [] ps;
  
   return 0;
}     
 




相关文章

相关软件