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 ecjtuwh at 2007-01-22 19:32:29 on Problem 2894
#include<iostream>
#include<stdlib.h>
int qf(const void* a,const void *b)
{
    return *(int*)a-*(int*)b;
}
using namespace std;
int main()
{
 int i,j,k,m,n,max,min,total,t;
 int a[280],b[280],sum;
 char c;
 cin>>m;
 while(m--)
  {
   min=1001;max=0;
   cin>>n;
   for(i=1;i<=n;i++)
     cin>>c>>a[i]>>b[i];
  qsort(a+1,i-1,4,qf);
  qsort(b+1,i-1,4,qf);
  min=a[1];
  max=b[i-1];
  sum=0;k=1;t=1;
  for(i=min;i<=max;i++)
    {
     if(i==a[t]) {sum++;t++;}
     if(i==b[k]) {sum--;k++;}
     c=sum+64;
     if(sum==0) continue;
     else  cout<<c;
    }    
  cout<<endl;
  }    
}    

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