Cod sursa(job #1825067)
| Utilizator | Data | 8 decembrie 2016 18:25:33 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char a;
int s=0,z=0;
f.get(a);
if((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
s++;
while(!f.eof())
{
char b;
f.get(b);
if((b>='a'&&b<='z')||(b>='A'&&b<='Z'))
{
if(!((a>='a'&&a<='z')||(a>='A'&&a<='Z')))
z++;
s++;
}
a=b;
}
g<<s/z;
return 0;
}
