Pagini recente » Cod sursa (job #3178448) | Cod sursa (job #1160196) | Cod sursa (job #3221706) | Cod sursa (job #3181495) | Cod sursa (job #1367702)
#include<iostream>
#include<cstring>
#include<fstream>
using namespace std ;
ifstream fin ("text.in");
ofstream fout ("text.out");
int main()
{
char s[251] ;
int cnt = 0 ;
char sep[] = " ,-;";
int cnnt = 0 ;
fin.getline(s,251);
char *p ;
p = strtok(s , sep);
while (p)
{
cnnt ++;
for (int i = 0 ; i<=strlen(p)-1;i++)
cnt ++ ;
p = strtok (NULL ,sep);
}
double plm = cnt / cnnt;
fout << cnt << " " << cnnt << " " <<(int) plm;
return 0;
}