Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int gcd(int a, int b) {
- while (b != 0) {
- int temp = b;
- b = a % b;
- a = temp;
- }
- return a;
- }
- int main() {
- int num1 = 48, num2 = 18;
- cout << "НСД: " << gcd(num1, num2) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment