Cod sursa(job #1541632)
Utilizator | Data | 4 decembrie 2015 14:29:16 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <cstdio>
using namespace std;
int i,s,n;
char x,y;
bool litera(char x)
{
return x>='a'&&x<='z'||x>='A'&&x<='Z';
}
int main()
{
y=';';
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(cin.get(x))
{
if(litera(x))
{
s=s+1;
if(!litera(y))
{
n=n+1;
}
}
y=x;
}
cout<<s/n;
}