Follows 594.c (Total 24 lines):

/* @JUDGE_ID:4461XX 594 C "bit operator" */
/* A */
/* detail in 594.txt */
#include<stdio.h>

int main( void )
{
	int n , i , tmp[4] ;

	while( scanf( "%d" , &n )==1 ){
		printf( "%d converts to " , n ) ;

		tmp[0] = ( n<<24 ) & ( -16777216 ) ;
		tmp[1] = ( n<<8 ) & ( 16711680 ) ;
		tmp[2] = ( n>>8 ) & ( 65280 ) ;
		tmp[3] = ( n>>24 ) & ( 255 ) ;
		for( n=i=0 ; i<4 ; i++ ) n |= tmp[i] ;

		printf( "%d\n" , n ) ;
	}

	return 0 ;
}
/* @END_OF_SOURCE_CODE */

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