Cod sursa(job #1292853)
Utilizator | Data | 14 decembrie 2014 21:10:58 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <iostream>
#include <math.h>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char s;
int cuv = 1, ltot = 0;
while (cin.get(s))
{
if (s == ' ')
{
cuv = cuv + 1;
}
else
{
if ((s >= 'a' && s <= 'z') | (s >= 'A' && s <= 'Z'))
{
ltot = ltot + 1;
}
}
}
g<<ltot / cuv;
return 0;
}