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 soligho at 2008-07-28 16:53:39 on Problem 1007
#include<stdio.h>
char str[100][50];
void main()
{ 
   char (*p)[50];
   long M,m;
   int i,j,k,volom,row;
   long int a[100]={0};
   scanf("%d %d",&volom,&row);
    p=str;
   for(i=0;i<row;i++)
    scanf("%s",str[i]);
   for(i=0;i<row;i++)   
	for(k=0;k<volom-1;k++)
		for(j=k+1;j<volom;j++)
		     if(*(*(p+i)+k)>*(*(p+i)+j))	
			    a[i]+=1;
	  M=50000;
	  for(m=0;m<M;m++)
	   for(i=0;i<row;i++)
	      if(a[i]<m)
		  { printf("%s\n",(p+i));
             a[i]=M;
		  }
}

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