Cod sursa(job #2139903)
| Utilizator | Data | 22 februarie 2018 21:16:22 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[300],*p;
int sum,k;
int main()
{
f.get(s,300);
p=strtok(s,"- ,.!?");
while(p)
{
k++;
sum+=strlen(p);
p=strtok(NULL,"- ,.!?");
}
g<<sum/k;
}
