Pagini recente » Cod sursa (job #1750877) | Cod sursa (job #1792686) | Cod sursa (job #2701059) | Cod sursa (job #1344854) | Cod sursa (job #818846)
Cod sursa(job #818846)
#include <string.h>
#include <fstream>
#include <cmath>
using namespace std;
int main()
{
char s[100000],d[]=" -?!,",*p;
int i,c=0,x=0;
ifstream f("text.in");
ofstream g("text.out");
f.get(s,100);
for(i=0;i<strlen(s);i++)
{
if(strchr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s[i])!=NULL)
c++;
}
p=strtok(s,d);
while(p)
{
x++;
p=strtok(NULL,d);
}
g<<c/x;
return 0;
}