Pagini recente » Cod sursa (job #2118328) | Cod sursa (job #1045110) | Cod sursa (job #956420) | Cod sursa (job #1666806)
// test1.cpp : Defines the entry point for the console application.
//
//#include "stdafx.h"
#include "stdio.h"
#include "fstream"
#include "iostream"
#include "string"
using namespace std;
void citire(int* x)
{
ifstream myfile;
myfile.open("fact.in");
myfile >> *x;
myfile.close();
}
void scriere(int x)
{
ofstream outfile;
outfile.open("fact.out");
outfile << x;
outfile.close();
}
int main()
{
int p;
int m2=0, m5=0, m10=0,i=1;
citire(&p);
while(m10<p)
{
i++;
if (i%2==-0) {
m2++;
}
if ((i%5)==0) {
m5++;
}
if ((m2>=1)&&(m5>=1)){
m10++;
m2=0;
m5=0;
};
};
scriere(i);
return 0;
}