Cod sursa(job #2576425)
Utilizator | Data | 6 martie 2020 19:19:54 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char s[100];
char *t;
int n,k=0;
f.get(s,255);
t=strtok(s," -,.!?");
while(t)
{
k++;
n=n+strlen(t);
t=strtok(NULL," -,!?.");
}
g<<n/k;
return 0;
}