Cod sursa(job #1115576)
| Utilizator | Data | 21 februarie 2014 21:50:45 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.67 kb |
/// Craciun Catalin
/// Text
/// www.infoarena.ro/problema/text
#include <fstream>
#include <iostream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
long cuv=0;
long lit=0;
bool toAdd=true;
void solve()
{
while (!f.eof())
{
char c;
f>>noskipws>>c;
if ((c>='a' && c<='z') || (c>='A' && c<='Z'))
{
lit++;
if (toAdd)
{
cuv++;
toAdd=false;
}
}
else
toAdd=true;
}
g<<lit/cuv<<'\n';
g.close();
}
int main()
{
solve();
return 0;
}
