Cod sursa(job #805812)
Utilizator | Data | 1 noiembrie 2012 10:45:52 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream>
#include<string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char c;
int l,nr,sw;
int main()
{
c=f.get();
while(c!=EOF)
{
if(c>='a' && c<='z' || c>='A' && c<='Z')
{
l++;
sw=1;
}
else
if(sw==1)
{
nr++;
sw=0;
}
c=f.get();
}
g<<l/nr;
return 0;
}