Cod sursa(job #2183042)
| Utilizator | Data | 22 martie 2018 19:28:36 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <bits/stdc++.h>
using namespace std;
char x[1001],*t,sep[]="\\ `1234567890-=~!@#$%^&*()_+[]{};':|,./<>?";
int lungime,cardinal;
int main()
{
ifstream in ("text.in");
ofstream out ("text.out");
in.get(x,1000);
t=strtok(x,sep);
while( t )
{
lungime+=strlen( t );
cardinal++;
t=strtok(NULL,sep);
}
if( cardinal==0 )
out<<0;
else
out<<lungime/cardinal;
in.close();
out.close();
return 0;
}
