Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int fan(int n1, int n2);
- int main() {
- int numb1, numb2, rez;
- cout << "numb1: ";
- cin >> numb1;
- cout << "numb2: ";
- cin >> numb2;
- rez = fan(numb1, numb2);
- cout << "rez: " << rez;
- return 0;
- }
- int fan(int min, int max) {
- int mod;
- mod = max % min;
- if (mod == 0) {
- return min;
- }
- min = mod;
- max = min;
- fan(min, max);
- }
Advertisement
Add Comment
Please, Sign In to add comment