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

自己的机器上结果正确。submit就WA。帮忙看看那里的错啊~~~~谢谢大牛啦~~

Posted by summertime at 2007-11-20 20:07:47 on Problem 2039
#include<stdio.h>
#include<string.h>
int main()
{
      int n, count ,t,i,j;
      char str[204],aa;
      char a[102][22];
   scanf("%d",&n);
   while(n!=0)
   {   scanf("%s",str);	
   			  count=0;
   			  memset(a,'\0',2244);
	  while(str[count]!='\0')
	  {
	      		 a[count/n][count%n]=str[count];
	      		 count++;
      }
      for(i=1;i<=count/n;i=i+2)
      {
	   	   for(j=0;j<(n-1)/2;j++)
	   	   {
		   	    aa=a[i][j];
		   	    a[i][j]=a[i][n-1-j];
		   	    a[i][n-1-j]=aa;
	       }
	  }
	  t=0;
	  for(i=0;i<n;i++)
	  {
		  for(j=0;j<count/n;j++)
		  {
		      str[t++]=a[j][i];      						
	      }
	  }
	  str[t]='\0';
	  printf("%s\n",str);
      
   scanf("%d",&n);		  
   }
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