Pagini recente » Cod sursa (job #737152) | Cod sursa (job #6149) | Cod sursa (job #1928685) | Cod sursa (job #2400953) | Cod sursa (job #2204161)
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
int main ()
{
string text;
int nr=0,nr2=0;
bool cond=false;
getline (fin,text);
for (int i=0;i<=text.length()-1;i++)
{
if (((text[i]>=97) &&(text[i]<=122)) || ((text[i]>=65) && (text[i]<=90)))
{
nr++;
cond=true;
}
else if (cond==true)
{
nr2++;
cond=false;
}
}
fout << nr/nr2;
return 0;
}