1. Список говнокодов пользователя BeardRED

    Всего: 2

  2. Си / Говнокод #4713

    +145

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    /*----------------------------------------------------------------------------*/
    double XzMinSec( double XBOCT, unsigned int OKP){ /*Gr(Ch).dG(dC)->Gr(Ch)MS.dS*/
    signed int  min,  xz = XBOCT; XBOCT-=xz; min=60*XBOCT;  XBOCT=(XBOCT*60-min)*60;
    if (XBOCT>=59.5) { unsigned char teg[32]; double n =  pow(10,OKP) * (XBOCT-min);
    signed int z=n;n-=z; if(n>=0.5||n<=-0.5){ signed int x,y=0; sprintf(teg,"%d",z);
    while(teg[y]!='\0') y++;  z=1; for( x=0; x<OKP; x++ )  if ( teg[--y]!='9' ) z=0;
    if(z==1) if(abs(min)==59) if(min<0) XBOCT=-4100; else XBOCT=4100; else if(min<0)
    XBOCT=-100; else XBOCT=100; }}     return  xz * 10000  +  min * 100  +  XBOCT; }
    /*----------------------------------------------------------------------------*/

    гм... работает...

    BeardRED, 22 Ноября 2010

    Комментарии (47)
  3. Си / Говнокод #4712

    +145

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    /*---------------------------------------------------------------------------------------------------------------*/
    double XzMinSec(double XBOCT,unsigned int OKP){ /*Gr(Ch).dG(dC)->Gr(Ch)MS.dS*/
    signed int  min, xz=XBOCT;  XBOCT-=xz;min=60*XBOCT; XBOCT=(XBOCT*60-min)*60;
    if (XBOCT>=59.5) {  unsigned char  teg[32];  double n =  pow (10,OKP) * (XBOCT-min);
    signed int z=n; n-=z;  if ( n>=0.5 || n<=-0.5 ) {  signed int x, y=0; sprintf ( teg, "%d", z);
    while ( teg[y]  !=  '\0'  )  y++;   z=1;   for ( x=0;  x<OKP;  x++ )  if  ( teg[--y]  !=  '9'  )  z=0;
    if(z==1)  if (abs(min) == 59 ) if(min<0) XBOCT=-4100; else XBOCT=4100; else if(min<0)
    XBOCT = -100;  else XBOCT = 100;  } }       return  xz * 10000  +  min * 100  +  XBOCT; }
    /*----------------------------------------------------------------------------------------------------------------*/

    гм... работает...

    BeardRED, 22 Ноября 2010

    Комментарии (0)