Cod sursa(job #1072679)
| Utilizator | Data | 4 ianuarie 2014 19:15:41 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <fstream>
#include<cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[101],*p,a[101][101];
unsigned int k,q,i;
int main()
{
f.get(s,101);
p=strtok(s," ,.!?");
while(p)
{
strcpy(a[k++],p);
p=strtok(0," ,.!?");
}
for(i=1;i<=k;i++)
q+=strlen(a[i]);
g<<q/k;
return 0;
}
