Cod sursa(job #1516808)
Utilizator | Data | 3 noiembrie 2015 16:52:35 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <fstream>
#include <cstring>
#include <iostream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s;
int main()
{
int lng=0,cnt=0;
while(f.get(s))
{
if((s>='a' && s<='z') || (s>='A' && s<='Z'))
{
while((s>='a' && s<='z') || (s>='A' && s<='Z'))
{
lng++;
f.get(s);
}
cnt++;
}
}
g<<lng/cnt<<"\n";
return 0;
}