Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- //resubmission
- int main()
- {
- int j,i,n,x[105],temp,s;
- scanf("%d",&n);
- for(i=0;i<n;i++){
- scanf("%d",&x[i]);
- }
- for(i=0;i<n;i++){
- for(j=i+1;j<n;j++){
- if(x[i]>x[j]){
- temp=x[i];
- x[i]=x[j];
- x[j]=temp;
- }
- }
- }
- s=0;
- for(i=0;i*2<n;i++){
- s=s+(x[i]+2)/2;
- }
- printf("%d\n",s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement