Cod sursa(job #1244874)
Utilizator | Data | 18 octombrie 2014 12:45:24 | |
---|---|---|---|
Problema | Pascal | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("pascal.in");
ofstream g("pascal.out");
int r,d,j,s,tj=1,tj1,c;
int main()
{
f>>r>>d;
for(j=1;j<=r-1;j++){
tj1=tj*(r-j+1)/(j);
if(tj1%d==0)
c++;
tj=tj1;
}
g<<c<<endl;
return 0;
}