File: gcd.c

package info (click to toggle)
cmix 2.0.11-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,224 kB
  • ctags: 5,925
  • sloc: cpp: 29,558; ansic: 11,452; yacc: 2,020; sh: 1,795; makefile: 1,228; lex: 484; perl: 278
file content (9 lines) | stat: -rw-r--r-- 170 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
int main(int x, int y) {
  /* greatest common divisor */
  while (x != y) {
    if      (x > y) x = x - y;
    else if (y > x) y = y - x;
    else ;
    }
  return x;
}