Pagini recente » Cod sursa (job #2725195) | Cod sursa (job #2258820) | Cod sursa (job #2383916) | Cod sursa (job #641442) | Cod sursa (job #782773)
Cod sursa(job #782773)
#include <iostream>
#include <cstdio>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int nrc = 1, nrtl = 0;
int thischar = fin.get();
while (thischar != '\n')
{
if ( thischar >= 97 && thischar <= 122 )
nrtl++;
else
if ( thischar >= 65 && thischar <= 90 )
nrtl++;
else
if ( thischar == ' ')
nrc++;
thischar = fin.get();
}
fout << nrtl/nrc;
return 0;
}