Pagini recente » Cod sursa (job #2114383) | Cod sursa (job #420911) | Cod sursa (job #103146) | Cod sursa (job #382724) | Cod sursa (job #549255)
Cod sursa(job #549255)
#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;
}