.[ ČeskéHry.cz ].

Laboratoř ČeskýchHer.cz - PasteBin

Vložit nový kód

ČeskéHry.cz - KOMUNITA HERNÍCH VÝVOJÁŘŮ

  1. Teens popular sex
    2 hod
  2. Teens popular sex
    2 hod
  3. CP lovers forum
    2 hod
  4. CP lovers forum
    2 hod
  5. Mega l3aks video C-P mega
    4 hod
  6. Mega l3aks video C-P mega
    4 hod
  7. Mega l3aks video C-P mega
    4 hod
  8. Mega l3aks video C-P mega
    4 hod
  9. Mega l3aks video C-P mega
    4 hod
  10. Mega l3aks video C-P mega
    4 hod
Link: http://nopaste.ceske-hry.cz/subdom/nopaste222807
Jazyk: C
Vloženo: 16.12.2009, 22:37
Stáhnout jako soubor
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5.  
  6. typedef struct
  7. {
  8. float a;
  9. float b;
  10. float c;
  11. } Col;
  12.  
  13. int main()
  14. {
  15. int width = 800;
  16. int height = 600;
  17.  
  18. Col** array = malloc(width * sizeof(Col*));
  19. for (int i = 0; i!= width; i++)
  20. {
  21. array[i] = malloc(height * sizeof(Col));
  22. }
  23.  
  24. for (int i = 0; i != width; i++)
  25. {
  26. for (int j = 0; j != height; j++)
  27. {
  28. array[i][j].a = 1;
  29. array[i][j].b = 2;
  30. array[i][j].c = 3;
  31. }
  32. }
  33.  
  34. int start;
  35. while (1)
  36. {
  37. start = clock();
  38.  
  39. Col* arrayPtr = NULL;
  40.  
  41. for (int i = 0; i != width; i++)
  42. {
  43. arrayPtr = array[i];
  44.  
  45. for (int j = 0; j != height; j++)
  46. {
  47. arrayPtr->a = (arrayPtr->b) * (arrayPtr->c);
  48. arrayPtr->b = (arrayPtr->a) * (arrayPtr->c);
  49. arrayPtr->c = (arrayPtr->a) * (arrayPtr->b);
  50. arrayPtr++;
  51. }
  52. }
  53.  
  54. printf("%i\n", (int)((clock() - start)*1E3/CLOCKS_PER_SEC));
  55. }
  56.  
  57. return 0;
  58. }
  59.