Cod sursa(job #879528)
| Utilizator | Data | 15 februarie 2013 16:10:56 | |
|---|---|---|---|
| Problema | Invers modular | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.23 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;(a*x)%n!=1;x++);
fout<<x;
}
