Cod sursa(job #549255)

Utilizator romykPrehari Romica romyk Data 8 martie 2011 11:54:34
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <iostream>
#include<fstream>
#include<string.h>
using namespace std;
fstream f("text.in",ios::in);
fstream g("text.out",ios::out);
long i,n,nrc;
char a[20000000],*p;
int main()
{n=0;
nrc=0;
while(!f.eof())
{f>>a;
if(!f.eof())
{
p=strtok(a," .,!?-=+:;'");
while(p)
{
   nrc++;
   n=n+strlen(p);
   p=strtok(NULL," .,!?-=+:;'");
}
}
}
cout<<n<<" "<<nrc;

return 0;
}