All pastes #418771 Raw Edit

Miscellany

public text v1 · immutable
#418771 ·published 2007-03-31 20:38 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define a 48
#define b 122

int main(int argc, char *argv[])
{
 srand ( time(NULL) );
  int x;
  long i = 0;
  long f = 0;
  int p = 0;
  char z;
  int cur = 0;
  int cur2 = 0;
  char y[500];
  FILE* input = NULL;
  FILE* output = NULL;
  input = fopen(argv[1], "r");
  output = fopen("output.drg", "w");
  do{
      z = fgetc(input);
      y[cur] = z;
      cur++;
     } while (cur < 329);
  do{
      fputc(y[cur2],output);
      cur2++;
     } while (cur2 < 329);
 /* while(p<=250)
  {
      z = fgetc(input);
      p++;
  }*/    
  fseek(input,301,SEEK_SET);
  while(i <= 1637)
  {
      while(f <= 77)
      {
        printf("%c", ((x=a+((float)rand()*(b-a)/RAND_MAX))));  
        fputc(("%c", ((x=a+((float)rand()*(b-a)/RAND_MAX)))),output);
        f++;
      }
      printf("%c\n", ((x=a+((float)rand()*(b-a)/RAND_MAX)))); 
      fputc(("%c", ((x=a+((float)rand()*(b-a)/RAND_MAX)))),output);  
      f = 0;    
      i++;
  }    
  fseek(input,126457,SEEK_SET);
  z = ' ';
  cur = 0;
  cur2 = 0;
   do{
      z = fgetc(input);
      y[cur] = z;
      cur++;
     } while (z != EOF);
  do{
      fputc(y[cur2],output);
      cur2++;
     } while (z != EOF);
  fclose(input);
  fclose(output);
  system("PAUSE");	
  return 0;
}