Cod sursa(job #1525705)
Utilizator | Data | 15 noiembrie 2015 14:17:42 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | 11A | Marime | 0.48 kb |
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char s[100],*cuv;
int n,i,lit=0,cuvinte=0;
fin.getline(s,100);
n=strlen(s);
for(i=0;i<=n-1;++i) if(isalpha(s[i]))lit++;
strtok(s," ,.-");
while(cuv!=NULL)
{
cuvinte++;
cuv= strtok(NULL, " ,.-");
}
fout<<lit/cuvinte;
return 0;
}