Cod sursa(job #2228336)
Utilizator | Data | 3 august 2018 14:08:35 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <iostream>
#include<fstream>
#include <string.h>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
char a[1000010],*p;
int k,pi,i;
int main()
{while(f.get(a[i]))
i++;
p=strtok(a," ,-,!,0,1,2,3,4,5,6,7,8,9");
pi=pi+strlen(p);
while(p)
{
p=strtok(NULL," ,-,!");
k++;
if(p!=NULL)pi=pi+strlen(p);
}
g<<pi/k;
return 0;
}