Cod sursa(job #1478354)
| Utilizator | Data | 28 august 2015 14:35:44 | |
|---|---|---|---|
| Problema | Invers modular | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.28 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("inversmodular.in");
ofstream out("inversmodular.out");
int main()
{
long a,n,i=1;
fin>>a>>n;
while(a*i%n!=1)
i++;
out<<i;
fin.close();
out.close();
return 0;
}
