Cod sursa(job #1877964)
Utilizator | Data | 13 februarie 2017 20:05:07 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 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<<endl;
cout<<lit/nrcuv;
return 0;
}