讨论 / 255怎么会有负数呢?
2013cqf 2011-07-17 03:20:00
点我顶贴 收藏 删除
#include<iostream>

using namespace std;

long long pe[100000];

long long ans[100000];

int main()

{

int b,e;

long long c;

double a,d;

cin>>a;

e=a;

for(b=1;b<=a;b++)

{

cin>>pe[b];

ans[b]=pe[b];

}

sort(pe,pe+e+1);

c=0.00;

for(b=1;b<=a;b++)

{

for(e=1;e<=a;e++)

{

if(ans[e]==pe[b])

{

if(b==a)

{

cout<<e<<endl;

ans[e]=INT_MAX;

break;

}

cout<<e<<" ";

ans[e]=INT_MIN;

break;

}

}

c=c+pe[b]*(10-b);

}

d=c/a;

printf("%.2f\n",d);

return 0;

}

#1 2013cqf@2011-07-17 03:20:00
回复 删除
float
查看更多回复
提交回复