Cod sursa(job #1412348)
| Utilizator | Data | 1 aprilie 2015 11:35:03 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
#include <cstring>
#define nmax 1048580
using namespace std;
int main()
{
const char ctdel[100]="`1234567890-=[];'\./,!@#$%^&*()_+{}:|<>? ~";
ifstream f("text.in");
ofstream g("text.out");
char s[nmax],*res;
int c=0,suma=0;
f.get(s,nmax);
res=strtok(s,ctdel);
while(res != NULL)
{
c++;
suma+=strlen(res);
res=strtok(NULL,ctdel);
}
g<<suma/c;
return 0;
}
