Cod sursa(job #2069328)
Utilizator | Data | 18 noiembrie 2017 12:53:36 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | evaluare_cex_sv_cls_x | Marime | 0.42 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char s[5000],*p;
int i,nrl=0,nrc=0;
f.getline(s,5000);
for (i=0;s[i];i++)
if (isalpha(s[i]))
nrl++;
p=strtok(s," -,!?.;:");
while (p)
{
nrc++;
p=strtok(NULL," -,!?.;:");
}
g<<nrl/nrc;
return 0;
}