Cod sursa(job #879533)
Utilizator | Data | 15 februarie 2013 16:20:03 | |
---|---|---|---|
Problema | Invers modular | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("inversmodular.in");
ofstream fout("inversmodular.out");
int main()
{
int a,n,x;
fin>>a>>n;
for(x=1;((long long)a*x)%n!=1;x++);
fout<<x;
}