Cod sursa(job #1716482)
Utilizator | Data | 12 iunie 2016 21:24:51 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{ int s,n; s=0;n=0; bool ok;
char c,x;
while(f.get(c))
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) {s++; ok=1;}
else if(ok) {ok=0; n++;}
}
g<<s/n;
return 0;
}