| ||||||||||
| 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:up一下 T_TIn Reply To:谁能花一分钟帮我看下这个程序啊?我快疯了~~~~~ Posted by:kansas at 2005-11-27 20:16:32 > 这个程序在vc6.0中运行没问题,用GCC(Dev c++)交就ce
>
> // 对数组排序的那部分出问题了,我把它单独抽出来了。
> #include <iostream>
> #include <fstream>
> #include <algorithm>
> #include <vector>
>
> using namespace std;
>
> class Seq
> {
> public:
> int org,cost;
> inline bool operator < (Seq &b)
> {
> if (this->cost < b.cost)
> {
> return true;
> }
> return false;
> }
> };
>
> 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