Cod sursa(job #3239015)
Utilizator | Data | 1 august 2024 12:59:49 | |
---|---|---|---|
Problema | Invers modular | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.25 kb |
#include <iostream>
#include <fstream>
int main(){
std::ifstream bem("inversmodular.in");
int a, n;
bem >> a >> n;
bem.close();
int x = 1;
while(a*x % n != 1)
x++;
std::ofstream kim("inversmodular.out");
kim << x << "\n";
kim.close();
return 0;
}