Pagini recente » Cod sursa (job #983820) | Cod sursa (job #1110547) | Cod sursa (job #1745712) | Cod sursa (job #2458950) | Cod sursa (job #2219020)
#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;
f.get(text,9999);
for (i=0; i<strlen(text); 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;
}