Cod sursa(job #1564452)
| Utilizator | Data | 9 ianuarie 2016 18:04:04 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char citit;
int cuvant=0,litera=0,cica;
while(fin.get(citit))
{
if((citit>=65 && citit<=90) || (citit>=97 && citit<=122))
{
litera++;
cica=1;
}
else
{
if(cica)
{
cica=0;
cuvant++;
}
}
}
if(cica)
fout << litera/(cuvant+1);
else
fout << litera/cuvant;
return 0;
}