| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:谢谢了 :)In Reply To:This way.... Posted by:achilles at 2005-11-27 21:40:43 >
> #include <iostream>
> #include <fstream>
> #include <algorithm>
> #include <vector>
>
> using namespace std;
>
> class Seq
> {
> public:
> int org,cost;
> };
>
> bool operator < (const Seq& a, const Seq& b)
> {
> return a.cost < b.cost;
> }
>
> int main ()
> {
> freopen ("test.txt","r",stdin);
> Seq array[10];
>
> int i;
>
> for (i = 0;i < 10;i++)
> {
> cin >> array[i].cost;
> array[i].org = i;
> }
> sort (array,array + 10);
>
> return 0;
> }
>
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator