Skip to content

Instantly share code, notes, and snippets.

@ghost355
Last active November 9, 2024 05:15
Show Gist options
  • Save ghost355/f11dcaebcc0f21c39dad0087dcc35d0b to your computer and use it in GitHub Desktop.
Save ghost355/f11dcaebcc0f21c39dad0087dcc35d0b to your computer and use it in GitHub Desktop.
Nod НОД теорема Евклида рекурсия
#include<stdlib.h>
int nod(int x, int y) {
int a = abs(x);
int b = abs(y);
if (b > a) {
int temp = b;
a = b;
b = temp;
}
return b==0 ? a : nod(b, a%b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment