Pagini recente » Cod sursa (job #1571781) | Cod sursa (job #1139753) | Cod sursa (job #2136683) | Rating arose red (arose) | Cod sursa (job #2219021)
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char text[10000],*p;
int n=0,k=0,i,x;
f.get(text,9999);
x=strlen(text);
for (i=0; i<x; i++)
if ((text[i]>='a' && text[i]<='z') || (text[i]>='A' && text[i]<='Z'))
k++;
p=strtok(text," ");
while (p)
{
n++;
p=strtok(NULL," ");
}
g<<(int)k/n;
return 0;
}