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

求助各位大牛,大家所提到的问题我都注意到了,可为什么还是WR啊?谢谢了。

Posted by top1 at 2006-04-16 20:46:31 on Problem 2810
#include <iostream.h>
#include <stdio.h>
int main ()
{
	float     a , r , p ;
         char      u [ 255 ] , v [ 255 ] , b[ 255 ][ 255 ] ;
	int       i , j , k , judge [ 255 ] ;
    
	for ( i=0 ; i<255 ; i++)
		judge [ i ] = 2 ;
	i = 0;
	scanf ( "%f",&a )  ;
	while ( a >= 0 )
	{
		j = 1 ;
	         scanf( "%s%f",&u,&r ) ;
		gets ( v ) ;
                  p = a / r * 100 ;
		if ( p < 1.0 )
		{
			judge [ i ] = 0 ;
			k = 1;
			while ( v [ k ] != '\0' ) 
			{
                                      b [ i ][ k ] = v [ k ] ;
				 k++;
			}
			b [ i ][ k ] = '\0' ;
		}
		else
		{
			if ( int( p*10 ) % 10 > 4 )
			p++;
			judge [ i ] = 1 ; 
			while ( v [ j ] != '\0' )
			{
                   		printf ( "%c",v[j] );
				j++;
			}
	         printf("a");
                  printf ( "\b%.1f %s %.0f", a , u , p) ;
           	putchar('%');
           	printf ( "\n" );
		}
		i++;
          	scanf ( "%f",&a )  ;
	}
	puts("Provides no significant amount of:");
	for ( j = 0 ; j < i ; j ++ )
		if ( judge [ j ] == 0 )
		{
			for ( k = 1 ; b [ j ][ k+1 ] != '\0' ; k++ )
				printf ( "%c",b [ j ][ k ] );
		     	printf("\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