Cod sursa(job #2500653)
Utilizator | Plosceac Alexandre iM3nTh0LL | Data | 28 noiembrie 2019 13:57:06 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char c[1000];
f.getline(c,1000);
char delim[] = " ,.-123456789;:/><!@#$%ˆ&*()_+-`˜''""[]{}|?§±";
int nrl =0;
int nrc = 0;
char * str = strtok(c,delim);
while(str)
{
nrl += strlen(str);
nrc+=1;
str = strtok(NULL,delim);
}
g << nrl/nrc;
}