Mai intai trebuie sa te autentifici.
Cod sursa(job #2875638)
Utilizator | Data | 22 martie 2022 01:05:00 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout ("text.out");
char cuvant[1500000], *ptr;
int nrcuv, nrlittotal;
int main()
{
fin.getline(cuvant, 1500000);
ptr = strtok(cuvant, ".,/<>?:;'[]{}-_+=)(*&^%$#@!\|`~");
while (ptr != NULL)
{
nrcuv++;
nrlittotal += strlen(ptr);
ptr = strtok(NULL, ".,/<>?:;'[]{}-_+=)(*&^%$#@!\|`~");
}
if (nrcuv)
fout << nrlittotal/nrcuv;
else
fout << 0;
return 0;
}