Cod sursa(job #1329858)
| Utilizator | Data | 29 ianuarie 2015 21:58:57 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
char a[1100000], sir[]="-=[];',./~!@#$%^&*()_+{}|:<>? ",*p;
int main(){
ifstream f("text.in");
ofstream g("text.out");
int nr=0, n=0;
while(f.getline(a,1100000))
{
p=strtok(a,sir);
while(p!=0){
nr=nr+strlen(p);
p=strtok(NULL,sir);
n++;}
}
if(n)
g<<nr/n<<'\n';
else g<<0<<'\n';
return 0;}
