Cod sursa(job #1494148)
Utilizator | Data | 30 septembrie 2015 19:15:05 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <fstream>
using namespace std;
int main()
{
char c;
int l=0, gasit=0, nr=0;
ifstream g ("text.in");
ofstream h ("text.out");
while(!g.eof())
{
g>>c;
if(((c>=65) && (c<=90)) || ((c>=97) && (c<=122)))
{
l++;
if(!gasit)
nr++;
gasit=1;
}
else gasit=0;
}
h<<l/nr;
g.close();
h.close();
return 0;
}