Cod sursa(job #1677085)
Utilizator | Data | 6 aprilie 2016 12:31:42 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[1000001];
int main()
{
long l=0,cv=0,i;
f.getline(s,1000001);
i=0;
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')) l++;
for(i=1;i<strlen(s);i++)
{
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')) l++;
else
{
if((s[i-1]>='a'&&s[i-1]<='z')||(s[i-1]>='A'&&s[i-1]<='Z')) cv++;
}
}
g<<l/cv;
return 0;
}