Pagini recente » Cod sursa (job #1176135) | Cod sursa (job #3286988) | Cod sursa (job #117415) | Cod sursa (job #2672033) | Cod sursa (job #879970)
Cod sursa(job #879970)
#include<fstream>
#include<string.h>
#define dim 1000000
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char text[dim];
int n,nr,l;
int main()
{
f.get(text,dim);
int i=0;
n=strlen(text);
if((text[0]>'A' && text[0]<'Z') || (text[0]>'a' && text[0]<'z'))
{
nr++;
l=1;
}
i++;
while(i<=n)
{
if((text[i]<'A' || text[i]>'Z') && (text[i]<'a' || text[i]>'z'))
{
if((text[i+1]>='A' && text[i+1]<='Z') || (text[i+1]>='a' && text[i+1]<='z'))
nr++;
}
else
l++;
i++;
}
g<<l/nr<<"\n";
return 0;
}