输入两个集合中元素并显示[c++]

作者在 2006-06-11 04:59:00 发布以下内容

#include <iostream.h>
#include <string.h>
class set
{
 int a[10];
public:
 int m;
 void seta(int ele,int n){a[n]=ele;}
 void disp();

};
void set::disp()

for(m=0;m<=9;m++)
  cout<<a[m]<<" ";
}
void main()
{
 set b;
 set c;
 int x;
 int n;
 cout<<"Please input B:";
 for(n=0;n<=9;n++)
 {
  cin>>x;
  b.seta(x,n);
  
 }
 b.disp();
 cout<<"Please input C:";
 for(n=0;n<=9;n++)
 {
  cin>>x;
  c.seta(x,n);
 }
 b.disp();
 cout<<endl;
 c.disp();

}

海啸南风 发表于:2006-1-23 13:35:57 [编辑] [精华] [删除] [回复]

评论 海啸南风,你姐姐我qq有问题哦!

出问题了。八成弄不好啦,
安安波 发表于:2006-3-20 21:11:51 [删除] [回复]

评论 问个问题

怎么在最新链接里面设置项目呀,增加不了呀.我
crazyrabbit 发表于:2006-3-21 22:45:03 [删除] [回复]
c++开拓 | 阅读 1737 次
文章评论,共0条
游客请输入验证码