Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* krajšanje */
- int g(int &s, int &i, int &v, int &z) {
- int imenovalec = i;
- int stevec = s;
- v = s * i;
- z = s % i;
- while (z > 0) {
- s = i;
- i = z;
- z = s % i;
- }
- int skupniDelitelj = i;
- cout << "Najvecji skupni delitelj je " << skupniDelitelj << endl;
- cout << "Okrajšan ulomek: " << imenovalec / skupniDelitelj << " / " << stevec / skupniDelitelj << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement