Mai intai trebuie sa te autentifici.
Cod sursa(job #2193191)
| Utilizator | Data | 9 aprilie 2018 11:33:03 | |
|---|---|---|---|
| Problema | Pascal | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.78 kb |
#include <stdio.h>
using namespace std;
unsigned long long row;
int divider;
int main() {
freopen("pascal.in", "r", stdin);
freopen("pascal.out", "w", stdout);
scanf("%lld %d", &row, ÷r);
unsigned long long counter = 0;
unsigned long long ant = 1;
unsigned long long current = 0;
unsigned long limit = (row + 1) / 2;
if (row % 2 == 1) {
limit --;
}
for (unsigned long long k = 0; k < limit; k++)
{
current = ant * (row - k) / (k + 1);
if (current % divider == 0) {
counter += 2;
}
ant = current;
printf("%lld ", current);
}
printf("\n");
if (row % 2 == 0 && (current % divider == 0))
{
counter -= 1;
}
printf("%lld\n", counter);
return 0;
}