Cod sursa(job #942940)
| Utilizator | Data | 23 aprilie 2013 21:11:21 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<iostream>
#include<fstream>
using namespace std;
long long nr,l,la;
char c,cop;
int main()
{
ifstream f("date.in");
ofstream g("date.out");
cop=' ';
while(!f.eof())
{
f>>c;
if(('a'<=c&&c<='z')||('A'<=c&&c<='Z'))
l++;
else
if(('a'<=cop&&cop<='z')||('A'<=cop&&cop<='Z'))
{
nr++;
}
cop=c;
}
if(('a'<=cop&&cop<='z')||('A'<=cop&&cop<='Z'))
{
nr++;
}
g<<(int)(l/nr)<<'\n';
f.close();
g.close();
return 0;
}
