Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

感觉没错啊 求大神指点 哪里错了

Posted by 13503102626 at 2014-04-15 11:10:04 on Problem 2370
#include<iostream>
using namespace std;
int a[120];
int main()
{
	int k=0;
	cin>>k;
	getchar();
	for(int i=0;i<k;i++)
		cin>>a[i];

	int temp=0;
	int point=0;
	for(int i=0;i<k-1;i++)
	{
		point=i;
		for(int j=i+1;j<k;j++){
			if(a[j]<a[i])
				point=j; }
		if(point !=i){
		   temp=a[point];
		   a[point]=a[i];
		   a[i]=temp;}
	}
	int sum=0;
	
	for(int i=0;i<(k+1)/2;i++)
		sum+=(a[i]+1)/2;
	cout<<sum<<endl;
  return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator