从键盘输入10个整数,删除重复数,然后把剩下的数从小到达排列,想了好久才写出这么个东西,应该是最笨的实现方法了……
#include
void main()
{
int a[10],h[10],b=0,i,m,c,y,x,k;
for(i=0;i<10;i++)
h[i]=11;
cout<<"Please input 10 numbler:"< for(x=0;x<10;x++)
cin>>a[x];
for(y=0;y<9;y++)
for(x=1;y+x<10;x++)
if(a[y]==a[y+x])
{
h[y]=y;
b=b+1;
break;
}
k=10-b;
int z[10];
int j=0;
for(c=0;c<10;c++)
if(c!=h[c])
{
z[j]=a[c];
j=j+1;
}
cout<<"删除重复数后结果:"< for(m=0;m cout< cout<<"最后一位数为:"<
int o,p,q;
for(o=0;o for(p=o+1;p if(z[o]>z[p])
{
q=z[p];
z[p]=z[o];
z[o]=q;
}
cout<<"数字从小到大排列为:"< for(int r=0;r cout<}
#include
void main()
{
int a[10],h[10],b=0,i,m,c,y,x,k;
for(i=0;i<10;i++)
h[i]=11;
cout<<"Please input 10 numbler:"<
cin>>a[x];
for(y=0;y<9;y++)
for(x=1;y+x<10;x++)
if(a[y]==a[y+x])
{
h[y]=y;
b=b+1;
break;
}
k=10-b;
int z[10];
int j=0;
for(c=0;c<10;c++)
if(c!=h[c])
{
z[j]=a[c];
j=j+1;
}
cout<<"删除重复数后结果:"<
int o,p,q;
for(o=0;o
{
q=z[p];
z[p]=z[o];
z[o]=q;
}
cout<<"数字从小到大排列为:"<
#include
#include
using namespace std;
class Teacher
{public:
Teacher(string nam,int a,string t,string s,string addr,int num)
{name=nam;
age=a;
title=t;
sex=s;
address=addr;
nummber=num;
}
void display()
{cout<<"name"<cout<<"age"<cout<<"title"<cout<<"sex"<cout<<"address"<cout<<"nummber"<}
protected:
string name;
int age;
string title;
string sex;
string address;
int nummber;
};
class Cadre
{public:
Cadre(string nam,int a,string s,string addr,int num,string p)
{name1=nam;
age=a;
sex=s;
address=addr;
nummber=num;
post=p;}
void display()
{cout<<"name"<cout<<"age"<cout<<"sex"<cout<<"address"<cout<<"nummber"<cout<<"post"<}
protected:
string name1;
int age;
string sex;
string address;
int nummber;
string post;};
class Teacher_Cadre:public Teacher,public Cadre
{public:
Teacher_Cadre(string nam,int a,string t,string s,string addr,int num,string p,float w):
Teacher(nam,a,t,s,addr,num),Cadre(nam,a,s,addr,num,p),wage(w){}
void show()
{cout<<"name"< cout<<"age"< cout<<"sex"< cout<<"title"< cout<<"address"< cout<<"nummber"< cout<<"post"< cout<<"wage"< }
private:
float wage;
};
int main()
{Teacher_Cadre te_cad1("chen",19,"man","superman","qianqi",155xxxx0502,"charman",10000);
te_cad1.show();
return 0;}
#include
using namespace std;
class Teacher
{public:
Teacher(string nam,int a,string t,string s,string addr,int num)
{name=nam;
age=a;
title=t;
sex=s;
address=addr;
nummber=num;
}
void display()
{cout<<"name"<
protected:
string name;
int age;
string title;
string sex;
string address;
int nummber;
};
class Cadre
{public:
Cadre(string nam,int a,string s,string addr,int num,string p)
{name1=nam;
age=a;
sex=s;
address=addr;
nummber=num;
post=p;}
void display()
{cout<<"name"<
protected:
string name1;
int age;
string sex;
string address;
int nummber;
string post;};
class Teacher_Cadre:public Teacher,public Cadre
{public:
Teacher_Cadre(string nam,int a,string t,string s,string addr,int num,string p,float w):
Teacher(nam,a,t,s,addr,num),Cadre(nam,a,s,addr,num,p),wage(w){}
void show()
{cout<<"name"<
private:
float wage;
};
int main()
{Teacher_Cadre te_cad1("chen",19,"man","superman","qianqi",155xxxx0502,"charman",10000);
te_cad1.show();
return 0;}
隐约雷鸣,阴霾天空,但盼风雨来,能留你在此
隐约雷鸣,阴霾天空,即使天无雨,我亦留此地
很喜欢这两句诗,理解如下
#if Weather ==Rain
cout<<“The boy will stay with the girl”<<endl
#if (Weather ==Rain || Weather ==Sunshine)
cout<<“Boy has determined stayed here and praying the girl he loved"<<endl
#endif
隐约雷鸣,阴霾天空,即使天无雨,我亦留此地
很喜欢这两句诗,理解如下
#if Weather ==Rain
cout<<“The boy will stay with the girl”<<endl
#if (Weather ==Rain || Weather ==Sunshine)
cout<<“Boy has determined stayed here and praying the girl he loved"<<endl
#endif
✋热门推荐