Cod sursa(job #2228329)
Utilizator | Data | 3 august 2018 14:02:16 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <iostream>
#include<fstream>
#include <string.h>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
char a[1000000],*p;
int k,pi,pf;
int main()
{f.getline(a,1000000);
p=strtok(a," ,-,!");
pi=pi+strlen(p);;
while(p)
{
p=strtok(NULL," ,-,!");
k++;
if(p!=NULL)pi=pi+strlen(p);
}
g<<pi/k;
return 0;
}