📄 zz_2.cpp
字号:
#include <iostream.h>
class panxu
{
public:
void set_value();
void array_value();
void show_value();
private:
int array[10];
};
void panxu::set_value()
{
int i;
cout<<"input ten numbers:"<<endl;
for(i=0;i<10;i++)
cin>>array[i];
}
void panxu::array_value()
{
int i,j,temp;
for(i=0;i<10;i++)
for(j=i+1;j<10;j++)
if(array[i]>=array[j])
{
temp=array[i];
array[i]=array[j];
array[j]=temp;
}
}
void panxu::show_value()
{
int i;
cout<<"从小到大顺序是:"<<endl;
for(i=0;i<10;i++)
cout<<array[i]<<" ";
cout<<endl;
}
int main()
{
panxu t1;
t1.set_value();
t1.array_value();
t1.show_value();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -