Pagini recente » Rating Bolota Teofil (Teofil2003) | Cod sursa (job #862258) | Cod sursa (job #1305372) | Profil M@2Te4i | Cod sursa (job #387345)
Cod sursa(job #387345)
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#define z5 1
#define z25 6
#define z125 31
#define z625 156
#define z3125 781
#define z15625 3906
#define z78125 19531
#define z390625 97656
#define z1953125 488281
#define z9765625 2441406
#define z48828125 12207031
#define z244140625 61035156
#define z1220703125 305175781
long p;
long rez = 0;
FILE *fin, *fout;
void rezolva()
{
if (p < 1) { }
else if (p < 6) { p--; rez = p * 5 + 5; }
else if (p < 31) { p-=6; rez = p * 5 + 25; }
}
int main()
{
fin = fopen("fact.in", "r");
fout = fopen("fact.out", "w");
fscanf(fin, "%d", &p);
rezolva();
fprintf(fout, "%d", rez);
fclose(fin); fclose(fout);
return 0;
}