Cod sursa(job #19193)
Utilizator | Data | 18 februarie 2007 21:20:10 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include<fstream.h>
#include<string.h>
#include<stdio.h>
int main()
{char s[344],*p;
int nr,l=0;
ifstream fin("text.in");
fin.getline(s,344);
fin.close();
l=strlen(s);
nr=0;
p=strtok(s," ,.;");
while(p!=NULL)
{l--;
nr++;
p=strtok(NULL," ,.;-:?!"");}
l=l+1;
ofstream fout("text.out");
fout<<int(l/nr);
fout.close();
return 0;}