Cod sursa(job #870641)
Utilizator | Data | 3 februarie 2013 19:26:24 | |
---|---|---|---|
Problema | Invers modular | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.23 kb |
#include<iostream>
#include<fstream>
using namespace std;
main(){
ifstream f1("inversmodular.in");
ofstream f2("inversmodular.out");
long long a,n,x;
f1>>a>>n;
for(x=1;x<n-1;x++)
if((a*x)%n==1)
f2<<x;
}