Pagini recente » Cod sursa (job #620629) | Cod sursa (job #340138) | Cod sursa (job #2959818) | Cod sursa (job #1858954) | Cod sursa (job #1934914)
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
char text[10000];
long long i,Lungime,k,p=0;
fstream f("text.in",ios::in);
f.get(text,10000);
f.get();
f.close();
k=0;
for(i=0;i<=strlen(text);i++)
{
if((text[i]<65)||(text[i]>90)&&(text[i]<97)||(text[i]>122)||(i==strlen(text)))
{
if((text[i-1]>=65)&&(text[i-1]<=90)||(text[i-1]>=97)&&(text[i]<=122))
{
k++;
}
}
else
{
p++;
}
}
Lungime=p/k;
fstream g("text.out",ios::out);
g<<Lungime;
g.close();
}