Cod sursa(job #644225)
Utilizator | Cristina Ungurean Cristina94 | Data | 5 decembrie 2011 17:50:25 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<stdio.h>
#include<string>
#include<iostream>
using namespace std;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int nr,a,b;
char s[1025], *p, sp[]=" ,.";
cin.get(s,100);
nr=b=0;
p=strtok(s,sp);
a=strlen(p);
b=b+a;
while(p)
{
nr++;
p=strtok(NULL,sp);
a=strlen(p);
b=b+a;
}
printf("%d %d", nr,b);
return 0;
}