Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- headeri.....
- #ifndef OPERACIJE_H
- #define OPERACIJE_H
- int zbroji(int x, int y);
- int oduzmi(int x, int y);
- int pomnoti(int x, int y);
- double podijeli(double x, double y);
- #endif
- #include "stdafx.h"
- int zbroji(int x, int y)
- {
- return x + y;
- }
- int oduzmi(int x, int y) {
- return x - y;
- }
- int pomnoti(int x, int y) {
- return x*y;
- }
- int podijeli(int x, int y) {
- return x / y;
- }
- #include "operacije.h"
- #include <iostream>
- using namespace std;
- int main{
- return 0;
- }
- ..................
- #ifndef OPERACIJE_H
- #define OPERACIJE_H
- void rucka(char z);
- #endif
- ....#include "stdafx.h"
- #include<cstdlib>
- #include<ctime>
- #include<iostream>
- using namespace std;
- void rucka(char z)
- {
- srand(time(NULL));
- int a = 1, b = 2, c = 3;
- char x;
- do
- {
- cout << "unsetite x da bi zavrtio";
- cin >> x;
- a = rand() % 3 + 1;
- b = rand() % 3 + 1;
- c = rand() % 3 + 1;
- cout << a << " " << b << " " << c << endl;
- } while (a != b || b != c || a != c);
- cout << "pobjeda!" << endl;
- cout << a << " " << b << " " << c << endl;
- }
- ...
- #include "stdafx.h"
- #include "operacije.h"
- #include <iostream>
- #include<ctime>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- char p;
- cin >> p;
- rucka(p);
- return 0;
- }
Add Comment
Please, Sign In to add comment