Pagini recente » Cod sursa (job #1349209) | Cod sursa (job #2104803) | Cod sursa (job #1005443) | Cod sursa (job #2196678) | Cod sursa (job #41916)
Cod sursa(job #41916)
#include<fstream.h>
#include<math.h>
ifstream f("text.in");
ofstream g("text.out");
long int i,nrc,nrl,n;
char s[10000000],*p,sep[]=" !@#$%^&*()_+|-=[]{};':,./<>?";
int main()
{
f.getline(s,10000000);
n=strlen(s);
for(i=0;i<n;i++)
if((s[i]>='A'&&s[i]<='Z')||(s[i]>='a'&&s[i]<='z'))
nrl++;
p=strtok(s,sep);
while(p)
{
nrc++;
p=strtok(NULL,sep);
}
g<<floor(nrl/nrc);
return 0;
}