64a27e41ea 2013-12-05 kinaba: // Enumerate coprime pythagoras triangles 64a27e41ea 2013-12-05 kinaba: 64a27e41ea 2013-12-05 kinaba: for(int m=1;; ++m) 64a27e41ea 2013-12-05 kinaba: for(int n=1; n<m; ++n) if(((m^n)&1) && gcd(m,n)==1) 64a27e41ea 2013-12-05 kinaba: { 64a27e41ea 2013-12-05 kinaba: int a = m*m-n*n, b = 2*m*n, c = m*m+n*n; 64a27e41ea 2013-12-05 kinaba: if(a>b) swap(a,b); 64a27e41ea 2013-12-05 kinaba: }