?? 3_13.cpp
字號:
#include<iostream.h>
#include<iomanip.h>
void swap(int &a,int &b);//函數(shù)聲明
int main()
{
void sort(int &a,int &b,int &c);//函數(shù)聲明
int a,b,c;
cout<<"請輸入三個整數(shù):"<<endl;
cin>>a>>b>>c;
sort(a,b,c);//函數(shù)調(diào)用
cout<<setw(3)<<a<<setw(3)<<b<<setw(3)<<c<<endl;
return(0);
}
void sort(int &a,int &b,int &c)//函數(shù)定義
{
if(a>b)
swap(a,b);
if(a>c)
swap(a,c);
if(b>c)
swap(b,c);
}
void swap(int &a,int &b)//函數(shù)定義
{
int t;//定義中間變量
t=a;
a=b;
b=t;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -