Cod sursa(job #2270136)
Utilizator | Data | 27 octombrie 2018 09:37:50 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream>
#include <cstring>
using namespace std;
int main()
{ char a[1000],*p,sep[]=" !,-*";
int i,lungime=0,nrcuv=0;
cin.get(a,1000);
p=strtok(a,sep);
while(p)
{
nrcuv++;
lungime=lungime+strlen(p);
p=strtok(NULL,sep);
}
cout<<lungime<<" "<<nrcuv;
return 0;
}