Наибольший общий делитель
#!/usr/bin/bc -q a=read() b=read() while (a!=0 && b!=0) if (a>b) a%=b else b%=a a b