pjobro

hedere

Mar 17th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.29 KB | None | 0 0
  1. headeri.....
  2. #ifndef OPERACIJE_H
  3. #define OPERACIJE_H
  4.  
  5. int zbroji(int x, int y);
  6. int oduzmi(int x, int y);
  7. int pomnoti(int x, int y);
  8. double podijeli(double x, double y);
  9.  
  10. #endif
  11.  
  12.  
  13. #include "stdafx.h"
  14.  
  15.  
  16.  
  17. int zbroji(int x, int y)
  18. {
  19.     return x + y;
  20. }
  21. int oduzmi(int x, int y) {
  22.     return x - y;
  23. }
  24. int pomnoti(int x, int y) {
  25.     return  x*y;
  26. }
  27. int podijeli(int x, int y) {
  28.     return x / y;
  29. }
  30.  
  31.  
  32. #include "operacije.h"
  33. #include <iostream>
  34.  
  35. using namespace std;
  36.  
  37. int main{
  38.     return 0;
  39. }
  40.  
  41. ..................
  42. #ifndef OPERACIJE_H
  43. #define OPERACIJE_H
  44.  
  45. void rucka(char z);
  46.  
  47.  
  48. #endif
  49. ....#include "stdafx.h"
  50. #include<cstdlib>
  51. #include<ctime>
  52. #include<iostream>
  53.  
  54. using namespace std;
  55.  
  56. void rucka(char z)
  57. {
  58.     srand(time(NULL));
  59.     int a = 1, b = 2, c = 3;
  60.     char x;
  61.  
  62.  
  63.  
  64.  
  65.     do
  66.     {
  67.         cout << "unsetite x da bi zavrtio";
  68.         cin >> x;
  69.         a = rand() % 3 + 1;
  70.         b = rand() % 3 + 1;
  71.         c = rand() % 3 + 1;
  72.         cout << a << " " << b << " " << c << endl;
  73.  
  74.  
  75.  
  76.     } while (a != b || b != c || a != c);
  77.  
  78.  
  79.     cout << "pobjeda!" << endl;
  80.     cout << a << " " << b << " " << c << endl;
  81.  
  82. }
  83. ...
  84. #include "stdafx.h"
  85. #include "operacije.h"
  86. #include <iostream>
  87. #include<ctime>
  88. #include<cstdlib>
  89.  
  90. using namespace std;
  91.  
  92.  
  93. int main()
  94. {
  95.    
  96.     char p;
  97.     cin >> p;
  98.     rucka(p);
  99.  
  100.     return 0;
  101. }
Add Comment
Please, Sign In to add comment