Cod sursa(job #786786)
Utilizator | Data | 12 septembrie 2012 01:38:04 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
#include <string>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int med,cuv,lit,ascii;
char c;
int main()
{
while(f.get(c))
{
ascii=c;
if (ascii>64 && ascii<91 ) lit++;
if (ascii>96 && ascii<123) lit++;
if (c==' ') cuv++;
}
cuv++;
med=lit/cuv;
g<<med;
f.close();
g.close();
return 0;
}