Cod sursa(job #1877973)
Utilizator | Data | 13 februarie 2017 20:09:08 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <string.h>
using namespace std;
char s[1001],*p;
int nrcuv,lit;
int main()
{
cin.getline(s,100);
p=strtok(s," ;,:");
while(p)
{
nrcuv++;
for(int i=0;i<strlen(p);i++)
if((p[i]>='a' && p[i]<='z') || (p[i]>='A' &&p[i]<='Z'))
lit++;
p=strtok(NULL," -;,:?!");
}
cout<<lit/nrcuv;
return 0;
}