home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / KTR.ARJ / KTR.C next >
Encoding:
C/C++ Source or Header  |  1996-01-14  |  546 b   |  28 lines

  1. #include <conio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5.  
  6. main()
  7. {
  8.     char    bBuf[ 16 ], *p, i;
  9.  
  10.     printf( "\nKTR --- KT-FleaMarket 2.13 Register" );
  11.  
  12.     printf( "\nEnter you telephone:");
  13.     bBuf[ 0 ] = 11;
  14.     cgets( bBuf );
  15.     p = &bBuf[ 2 ];
  16.     if( atoi( p ) == 0 ){
  17.         printf( "\nYour must input your telephone with all Number" );
  18.         exit( -1 );
  19.     }
  20.     i = 0;
  21.     while( *p ){
  22.         i += ( *p++ ) - '0';
  23.     }
  24.  
  25.     sprintf( bBuf, "%f", 657483.0*657483.0*i );
  26.     bBuf[ 10 ] ='\0';
  27.     printf( "\nYour Register code is: %s", bBuf );
  28. }