Created
December 17, 2017 12:34
-
-
Save Sammers21/e8dba31e83507d4f9e7233fe16c5db88 to your computer and use it in GitHub Desktop.
Тестирование задание №5 Здание
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//(0, 5) Покрывает из 16 строк = 2 | |
//(0, 5) Покрывает из 12 ветвлений = 1 | |
//(0, 5) Покрывает из 20 условий = 1 | |
int gcd(int a, int b) | |
{ | |
if(a == 0) // + | |
return b; // + | |
if(b == 0) | |
return a; | |
if(a == b) | |
return a; | |
if(a > 0 && b < 0 || a < 0 && b > 0) | |
b = -b; | |
do | |
{ | |
if(b > a && a > 0 || b < a && a < 0) | |
{ | |
a = b-a; | |
b = b-a; | |
a = a+b; | |
} | |
b = a-b; | |
a = a-b; | |
} | |
while(b != 0); | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment