Pagini recente » Cod sursa (job #1755135) | Cod sursa (job #1714625) | Cod sursa (job #393265) | Cod sursa (job #1585485) | Cod sursa (job #1289340)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char c;
int tl=0,cuv=0,nc=0;
while(!f.eof())
{
f.get(c);
if(cuv)
{
if(c>=91&&c<=96)
{
nc++;
cuv=0;
}
else if(c==0)
{
nc++;
cuv=0;
}
else if(c<='A'||c>='z')
{
nc++;
cuv=0;
}
}
if(c>='A'&&c<='z')
{
if(c<=91||c>=96)
{
tl++;
cuv=1;
}
else
{
cuv=0;
}
}
}
g<<tl/nc;
return 0;
}