今年暑假不AC
#include<stdio.h>
int main(){
int n,t;
int i,j;
int start[100],end[100];
int count;
while(scanf("%d",&n)!=EOF&&n!=0){
for(i=0;i<n;i++)
scanf("%d %d",&start[i],&end[i]);
for(i = 0;i<n-1;i++)
for(j=i+1;j<n;j++){
if(end[i]>end[j]){
t = start[i];
start[i] = start[j];
start[j] = t;
t=end[i];
end[i]=end[j];
end[j]=t;
}
}
t = end[0];
count = 1;
for(i=1;i<n;i++){
if(t<=start[i]){
count++;
t=end[i];
}
}
printf("%d\n",count);
}
return 0;
}