Cod sursa(job #632437)
Utilizator | Data | 11 noiembrie 2011 09:32:35 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream>
#include <cstdio>
using namespace std;
int nr=0,gasit,litere=0; char x;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
x=f.get();
while(x!=EOF)
{
if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
{
gasit=0;
litere++;
}
else
gasit++;
if (gasit==1&&litere!=0)
nr++;
x=f.get();
}
g<<litere/nr;
return 0;
}