finished int_gcd
This commit is contained in:
parent
8edc8dab71
commit
cd789112d7
1 changed files with 6 additions and 3 deletions
|
|
@ -177,7 +177,7 @@ bool rn_is_valid(RomanNumber number) {
|
|||
|
||||
RomanNumber rn_gcd(RomanNumber x, RomanNumber y) {
|
||||
if(x == 0 || y == 0) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int intX = rn_get_value(x);
|
||||
|
|
@ -185,9 +185,12 @@ RomanNumber rn_gcd(RomanNumber x, RomanNumber y) {
|
|||
|
||||
int result = int_gcd(intX, intY);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int int_gcd(int x, int y) {
|
||||
return 0;
|
||||
if(y == 0) {
|
||||
return x;
|
||||
}
|
||||
return int_gcd(y, x % y);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue