Cod sursa(job #2087782)

Utilizator skary98Betivu Vladislav skary98 Data 14 decembrie 2017 11:25:15
Problema Factorial Scor 0
Compilator cpp Status done
Runda bon Marime 0.45 kb
#include <stdio.h>
#include <fstream>
#include <iostream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
    int qwe=0,zxc;
    unsigned a;
    cin>>a;
    if (a==0){
     cout<<1;   
    }
    else {
    if ((a%6)==(5%6)){
        cout<<-1;
    }
    else{
    zxc=a*5;
        while (zxc/25!=0){
            qwe+=1;
        zxc/=25;
        }
        cout<<(a-qwe)*5;
    }
    }
    return 0;
}