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