Cod sursa(job #1196678)
Utilizator | Data | 8 iunie 2014 18:32:00 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char sir[1024*1024],*p, sep[]=",-!/.@#$%^&*()+= ";
int cuvinte, litere;
int main (){
in.get(sir, 1024*1024);
p=strtok(sir,sep);
while(p){
cuvinte++;
litere=litere+strlen(p);
p=strtok(NULL,sep);
}
out << litere/cuvinte;
return 0;
}