Cod sursa(job #19196)

Utilizator maleficpalade andrei malefic Data 18 februarie 2007 21:22:55
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 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;}