#include <stdio.h> int gcd( int a, int b) { if (b == 0) { return a; } return gcd(b, a % b); } int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); printf("%d\n", gcd(a, b)); printf("%d", gcd(b, c)); return 0; }
2 3 4
1 1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!