Cod sursa(job #1387001)
Utilizator | Data | 13 martie 2015 17:14:15 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<fstream>
#include<string.h>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
int main()
{
char s[10000];
int k=0;
char *p;
char sep[]=",.?:;-";
while(cin.getline(s,100))
{
p=strtok(s,sep);
while(p)
{
k++;
p=strtok(NULL,sep);
}
}
cout<<k;
return 0;
}