Cod sursa(job #2335204)
| Utilizator | Data | 3 februarie 2019 18:59:40 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[255], *p, sep[]="- ,!?/", c[10][10];
int main()
{
int k=0, i, d=0, j;
float t;
f.getline(s, 255);
p=strtok(s, sep);
while(p)
{
strcpy(c[k++], p);
p=strtok(NULL, sep);
}
for(i=0;i<k;i++)
{
for(j=0;j<strlen(c[i]);j++)
{
if(!strchr(sep, c[i][j]))d++;
}
}
t=d/k;
g<<t;
}
