Cod sursa(job #1588481)
| Utilizator | Data | 3 februarie 2016 09:24:07 | |
|---|---|---|---|
| Problema | Invers modular | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.28 kb |
#include <fstream>
using namespace std;
int main()
{
ifstream fin("inversmodular.in");
ofstream fout("inversmodular.out");
int a,n,b;
fin>>a>>n;
b=1;
while((a*b)%n!=1)
b++;
fout<<b;
fin.close();
fout.close();
return 0;
}
