Cod sursa(job #812440)
Utilizator | Data | 13 noiembrie 2012 21:17:57 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
using namespace std;
#include<iostream>
#include<fstream>
#include <stdio.h>
#include <string.h>
ifstream f("text.in");
ofstream g("text.out");
char x[200],i,*p,sep[]=" /.,?!-";
int nrlit,nrcuv;
int main()
{
f.get(x,200);
p=strtok(x,sep);
while(p)
{
nrlit=nrlit+strlen(p);
nrcuv++;
p=strtok(NULL,sep);
}
g<<nrlit/nrcuv;
return 0;
}