Cod sursa(job #918453)
Utilizator | Data | 18 martie 2013 21:32:49 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
using namespace std;
char c;
long long s1, s, nrlitere;
int main ()
{
ifstream f ("text.in");
ofstream g ("text.out");
while (f.get(c))
{
if (int (c) == 10) break;
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) s1++;
else
{
if (s1 != 0) s++;
nrlitere += s1;
s1 = 0;
}
}
g << nrlitere / s;
return 0;
}