- #include<stdio.h>
- #include<stdlib.h>
- #include<stdarg.h>
- #include<string.h>
- #include<ctype.h>
- int check[ 4 ] = {0} , Index[90] ;
- char file_name[50] , input[ 10000 ][ 90 ] , make[ 10000 ][ 90 ] ;
- int compare (const void *a, const void *b) ;
- int main( int argc , char *argv[] )
- {
- int i , j ;
- for( i = 1 ; i<argc-1 ; i++ )
- {
- check[ 0 ] = 0 ;
- check[ 0 ] = 1 ;
- {
- check[ 1 ] = 1 ;
- }
- check[ 2 ] = 1 ;
- check[ 3 ] = 1 ;
- }
- i = 0 ;
- {
- Index[ i ] = i ;
- i++ ;
- }
- if( check[ 1 ] )
- for( j = 0 ; j<i ; j++ )
- }
- int compare (const void *a, const void *b)
- {
- int i , j , order = 1 , a_value = *( int* )a, b_value = *( int* )b;
- if( check[0] ) order = -1 ;
- for( i = 0 , j = 0 ; j<=80 && i<=80 ; j++ , i++ )
- {
- while( check[ 2 ] && make[ a_value ][ i ] == ' ' )
- i++ ;
- while( check[ 2 ] && make[ b_value ][ j ] == ' ' )
- j++ ;
- if( make[ a_value ][ i ] == 0 && make[ b_value ][ j ] == 0 )
- {
- if( a_value<b_value ) return -1*order ;
- else return 1 *order;
- }
- else if( make[ a_value ][ i ] == 0 && make[ b_value ][ j ] != 0 )
- return -1 *order;
- else if( make[ a_value ][ i ] != 0 && make[ b_value ][ j ] == 0 )
- return 1 *order;
- make[ a_value ][ i ] -= 32 ;
- make[ b_value ][ j ] -= 32 ;
- if( make[ a_value ][ i ] < make[ b_value ][ j ] )
- return -1 *order;
- else if( make[ a_value ][ i ] > make[ b_value ][ j ] )
- return 1 *order;
- }
- }
Raw Paste