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

为什么是RUNTIMR ERROR????求救啊,我快崩溃啦!!1

Posted by 317781250 at 2008-06-25 15:07:54 on Problem 1007
#include <stdio.h>
main()
{int x,y,i,j,d[100],t,z=0;
 char a[100][51],b[100][51],temp;
 scanf("%d",&y);
 scanf("%d",&x);
 for(i=0;i<x;i++)
{scanf("%s",&a[i]);
 strcpy(b[i],a[i]);}
for(i=0;i<x;i++)
     {  for(d[i]=0,t=y;t>=z;t--)
     	for(j=y-1;j>z;j--)
       if(b[i][j]<b[i][j-1])
        {temp=b[i][j];
         b[i][j]=b[i][j-1];
         b[i][j-1]=temp;
         d[i]++;}
     }
     for(i=0;i<x-1;i++)
      {for(j=i+1;j<x;j++)
       if(d[i]>d[j])
         {t=d[i];
          d[i]=d[j];
          d[j]=t;
          strcpy(temp,a[i]);
          strcpy(a[i],a[j]);	
          strcpy(a[j],temp);
         }
         }
      for(i=0;i<x;i++)
        printf("%s\n",a[i]);
}

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