Cod sursa(job #2204696)
Utilizator | Runcan Alexandru Alex03 | Data | 16 mai 2018 20:34:54 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
int main ()
{
char lit;
int nr=0,nr2=0;
bool cond=false;
while (!fin.eof())
{
fin.get(lit);
int x = lit;
if ((x>=97 && x<=122) || (x>=65 && x<=90))
{
nr++;
cond=true;
}
else if (cond==true)
{
nr2++;
cond=false;
}
}
fout << nr/nr2;
return 0;
}