Project Euler #182: RSA encryption

  • + 0 comments

    include

    include

    include

    include

    include

    using namespace std;

    long gcd(long x, long y) { long r; while(y!=0) { r=x%y; x=y; y=r; } return x; }

    int main() { long phi,p,q, e, min=9999999,noum,ans=0; cin>>p>>q;
    phi=(p-1)(q-1); for(e=2;e(gcd(e-1,q-1)+1); if(noum