Follows 474.c (Total 31 lines):

/* @JUDGE_ID:4461XX 474 C */
/* A */
#include<stdio.h>
#define N 1000000
struct data{
	double num ;
	long e ;
}data[N] ;
void make_datatable( void )
{
	int i ;
	data[0].num = 5.0 ;
	data[0].e = 1 ;
	for( i=1 ; i<N ; i++ ){
		data[i].num = data[i-1].num * 5.0 ;
		data[i].e = data[i-1].e + 1 ;
		while( data[i].num >= 10.0 ){
			data[i].num /= 10.0 ;
			data[i].e-- ;
		}
	}
}
void main( void )
{
	long n , e , i ;
	double num ;
	make_datatable() ;
	while( scanf( "%ld" , &n ) == 1 )
		printf( "2^-%ld = %.3lfe-%ld\n" , n , data[n-1].num , data[n-1].e ) ;
}
/* @END_OF_SOURCE_CODE */

Back to statistics
Ya-Lin Huang (C)
huangyl@gmail.com