trojanxem

Untitled

May 27th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <conio.h>
  5. #include <time.h>
  6.  
  7. int main ()
  8. {
  9.   int i,n;
  10.   char *buffer;
  11.   int zarodek;
  12.     zarodek= time(NULL);
  13.     srand(zarodek);
  14.  
  15.   printf ("Dlugosc wyrazu : ");
  16.   scanf ("%d", &i);
  17.  
  18.   buffer = (char*) malloc (i+1);
  19.  
  20. do
  21. {
  22.   for (n=0; n<i; n++)
  23.    buffer[n]=rand();
  24.  
  25.   printf ("Losowa to: %d\n",buffer[n]);
  26. }
  27.   while(1);
  28.  
  29.   getch();
  30.  
  31.   return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment