Cod sursa(job #1608474)

Utilizator alexb97Alexandru Buhai alexb97 Data 22 februarie 2016 09:23:24
Problema Invers modular Scor 10
Compilator cpp Status done
Runda Arhiva educationala Marime 0.29 kb
#include <fstream>
using namespace std;

ifstream is("inversmodular.in");
ofstream os("inversmodular.out");

int x, a, n;

int main()
{
    is >> a >> n;
    x = 1;
    while(a*x % n != 1)
    {
        x++;
    }
    os << x;
    is.close();
    os.close();
    return 0;
}