Cod sursa(job #704676)
| Utilizator | Data | 2 martie 2012 19:31:48 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <string>
#include <fstream>
using namespace std;
int n,i;
char s[10000], * pch;
int main()
{
ifstream f("text.in");
freopen("text.out","w",stdout);
f.getline(s,sizeof(s));
n=0;
for(i=0; (int)i<=sizeof(s); i++)
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
n++;
i=0;
pch=strtok(s," ,.-");
while(pch != NULL)
{
i++;
pch=strtok(NULL," ,.-");
}
printf("%d",n/i);
return 0;
}
