Cod sursa(job #2196654)
| Utilizator | Data | 19 aprilie 2018 23:07:19 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <iostream>
#include <string.h>
#include <cstring>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[1000],sep[]=".?!,;- ",*c;
int i,nr,l,m;
int main()
{
fin.get(s,1000);
for(i=0;i<strlen(s);i++)
{
if(s[i]>='a'&&s[i]<='z'||s[i]>='A'&&s[i]<='Z')
{
l++;
}
}
c=strtok(s,sep);
while(c)
{
nr++;
c=strtok(NULL,sep);
}
m=l/nr;
cout<<m;
}
