Cod sursa(job #1514774)
Utilizator | Data | 31 octombrie 2015 16:21:44 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <fstream>
#include <cstring>
using namespace std;
int main()
{ifstream f("text.in");
ofstream g("text.out");
int x,s1=0,k=0;
char s[100001];
f.get(s,100000);
char *p=strtok(s,",!. ");
while(p)
{
s1=s1+strlen(p);
p=strtok(0,",!. ");
k++;
}
x=s1/k;
g<<x;
return 0;
}