Cod sursa(job #2297681)
Utilizator | Data | 6 decembrie 2018 10:53:01 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[1001];
unsigned i,k,k1;
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')))
{k++;
if(strchr(",. !-",s[i+1]))
k1++;
}
}
cout<<k/k1;
return 0;
}