Advertisement
globalbus

Untitled

May 15th, 2011
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <string.h>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. int i;
  9. int f;
  10. int diag;
  11. float *Pi;
  12. typedef struct A{
  13. char imie [25];
  14. char kolor[20];
  15. int dlugosc;
  16. } kot;
  17. kot longcat = {{'\0'}, {'\0'}, 20};
  18. sprintf(longcat.kolor, "%s", "bialy");
  19. printf("%s",longcat.kolor);
  20. srand(time(0));
  21. if(argc>1)
  22. diag = sscanf(argv[1], "%d", &f);
  23. else
  24. return -1;
  25. //printf("%d\n", f);
  26. //printf("diag %d\n", diag);
  27.  
  28. Pi = (float *)malloc(sizeof(float)*f);
  29. for(i=0; i<f;i++)
  30. Pi[i]=rand()%100;
  31. for(i=0; i<f; i++)
  32. printf("%f\t", Pi[i]);
  33. free(Pi);
  34. system("pause");
  35. return 0;
  36.  
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement