Cod sursa(job #1428456)
| Utilizator | Data | 4 mai 2015 16:34:49 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<iostream>
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char alfabet[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",S[501],*p;
int nr,x,Sum,k;
int main ()
{
f.get(S,501);
do
{
nr++;
}while(!strchr(alfabet,S[nr]));
p=strtok(S+nr," ,:;.?!-");
while(p)
{
x=strlen(p);
Sum+=x;
k++;
p=strtok(NULL," ,:;.?!-");
}
g<<Sum/k;
return 0;
}
