Cod sursa(job #2204163)
| Utilizator | Data | 14 mai 2018 20:09:40 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 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;
getline (fin,text);
int n=text.length()-1;
while (!fin.eof())
{
fin >> lit;
if ((lit>=97 && lit<=122) || (lit>=65 && lit<=90))
{
nr++;
cond=true;
}
else if (cond==true)
{
nr2++;
cond=false;
}
}
fout << nr/nr2;
return 0;
}
