久等了 :)
因為昨天後來就連不上來
我把它post在烏魯木齊班板上...
今天在cross-post過來
//begining of program
#include<iostream.h>
main()
{
int a[6],tmp=0;
for(int x=0;x<6;x++)
{
cin >> a[x];
}
for(int m=0;m<5;m++){
for(int n=m;n<5;n++)
{
if(a[n+1]>a[m])
{
tmp=a[n+1];
a[n+1]=a[m];
a[m]=tmp;
}
}
cout << "max:" << a[0] << endl;
cout << "min:" << a[5] << endl;
return 0;
}
//end of program
--
Kuo-Cheng Yu
kmd@ckeisc.ck.tp.edu.tw
Alumnus of Cheing Kuo Senior High School 53rd
Hardware Tutor of Electronic Industry Study Clud 19th
--
※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw)
◆ From: 203.204.57.230
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):