Pagini recente » Diferente pentru problema/rland intre reviziile 6 si 5 | Diferente pentru problema/rland intre reviziile 6 si 7 | Cod sursa (job #835288) | Cod sursa (job #1772896) | Cod sursa (job #1772898)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int nrcar, nrcuv;
int main()
{
char s,t;
while(f.get(s))
{
if((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z'))
++nrcar;
else if((t >= 'a' && t <= 'z') || (t >= 'A' && t <= 'Z'))
++nrcuv;
t=s;
}
g << nrcar / nrcuv;
return 0;
}