Paste Search Dynamic
Recent pastes
loop period
  1. #include <stdio.h>
  2. #define dwpd 1.3
  3. #define dwpd_year 5
  4.  
  5. int main(void) {
  6.         // your code goes here
  7.         unsigned long tmp =0;
  8.         int margi = 1;
  9.         //unsigned long cri = 1;
  10.         unsigned long pr = 4;
  11.         unsigned long gb = 1024*1024*1024;
  12.         //printf("%d  %d n", tmp < (cri-margi), (0.0 < -1.0));
  13.         //printf("%f %dn", (0.0-1), (0.0 < (0.0-1)) );
  14.         //printf("%ul %d %dn",(cri-margi), (tmp < cri-(unsigned long)margi), (tmp > 0+1));
  15.         pr = pr*gb;
  16.         unsigned long ze = 12345678901999999;
  17.         //printf("%lu n", pr);
  18.         //printf("%lx  %lun", pr, ze);
  19.         //printf("%u  %xn", pr, ze);
  20.         //printf("%lu n",ULONG_MAX);
  21.         //printf("%0161xn", pr);
  22.         //printf("%x  n", ze);
  23.         //pr = 4*1024*1024;
  24.         //pr = pr*1024;
  25.         //printf("%ld %ld  %ldn", 4*1024*1024, 4294967296, pr);
  26.         //pr = 4*1024*1024*1024;
  27.         //printf("%x  %ld  %dn", pr, pr, pr);
  28.         //if ( (int)(tmp < cri - margi) || (int)(cri+margi < tmp))
  29.         //if ( (tmp < (cri - margi)) || ( tmp > (cri+margi) ))
  30.         //{
  31.         //      printf("yes n");
  32.         //}
  33.         //else printf("no n");
  34.  
  35.         unsigned long diff = 800;
  36.         unsigned long cri = 1;
  37.         int sector = 0;
  38.         unsigned long cmd = 0;
  39.         //sector = (4*1024*1024*1024) / (diff*512);
  40.         //sector = (cri*gb) / (diff*512);
  41.         //printf("%d n", sector);
  42.  
  43.         //diff = (diff*sector*512) / gb;
  44.         //printf("%x n", diff);
  45.  
  46.         //cmd = 100*gb / (512*64);
  47.         //printf("%lu n", cmd);
  48.  
  49.         unsigned long s_lba = 0;
  50.         unsigned long e_lba = 3750748847;
  51.  
  52.         unsigned long tmps = 0;
  53.         unsigned long tmpe = 0;
  54.  
  55.         tmps = s_lba;
  56.         tmpe = e_lba;
  57.  
  58.         //e_lba = (((e_lba+1)/10)*2) / 8;
  59.         //e_lba = e_lba*8 - 1;
  60.         //s_lba = (((tmpe+1)/10)*1)/8;
  61.         //s_lba = s_lba*8;
  62.  
  63.         //printf("%lu  %lu n", s_lba, e_lba);
  64.  
  65.         for(int i =1; i < 10; i++)
  66.         {
  67.                 //printf("%lu  %lun",s_lba, e_lba);
  68.                 e_lba = (((e_lba+1)/10)*(i+1)) / 8;
  69.                 e_lba = e_lba*8 - 1;
  70.                 s_lba = (((tmpe+1)/10)*i)/8;
  71.                 s_lba = s_lba*8;
  72.                 //printf("[%d] %lu  %lu n", i*10, s_lba, e_lba);
  73.                 //printf("[%d] %x  %x n", i*10, s_lba, e_lba);
  74.  
  75.                 s_lba = tmps;
  76.                 e_lba = tmpe;
  77.         }
  78.  
  79.         unsigned long mx = 1875385007;
  80.         unsigned long dg = 0;
  81.         unsigned long tbw = 0;
  82.         unsigned long rLAB = 0;
  83.  
  84.         dg = (mx*512)/gb;
  85.         tbw = (dg*dwpd*dwpd_year*356)/1000;
  86.         //printf("%lu, %lu n",dg, tbw );
  87.         tbw = tbw/10;
  88.         rLAB = (tbw*1000) * gb / 512;
  89.         //printf("%lu %016lxn", rLAB, rLAB);
  90.  
  91.         int loop = 0;
  92.         int period = 0;
  93.  
  94.         //if (loop != 0) printf("loop n");
  95.         if( (loop != 0) && (period != 0)) printf("both n");
  96.         else if(loop != 0) printf("loop n");
  97.         else if(period != 0) printf("period n");
  98.         else printf("none n");
  99.  
  100.         return 0;
  101. }
  102.  
  103.  
Parsed in 0.010 seconds