Cod sursa(job #1384000)
| Utilizator | Data | 10 martie 2015 19:56:42 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include<string.h>
#include<stdlib.h>
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char cuv[10][10], s[100],sep[]=", -_;!?'.",*p;
int i=0,s1=0;
f.get(s,99);
p=strtok(s,sep);
while(p!=NULL)
{
i++;
strcpy(cuv[i],p);
p=strtok(NULL,sep);
}
for(int j=1;j<=i;j++)
s1=s1+strlen(cuv[j]);
g<<s1/i;
f.close();
g.close();
return 0;
}
