Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <cmath>
- using namespace std;
- int NOD( int x , int n) // общий делитель для двух чисел
- {
- if (n == 0)
- return x;
- else
- return NOD(n,x % n);
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- cout << NOD(48,6); // 2 числа , для которых хотим найти общий делитель
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement