Pagini recente » Cod sursa (job #1997043) | Cod sursa (job #834894) | Cod sursa (job #2355679) | Cod sursa (job #995439) | Cod sursa (job #2383892)
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int litere, cuvinte;
void rezolva(string a)
{
char x, y;
while(fin.get(x))
{
if((x>='a' && x<='z') || (x>'A' && x<='Z'))
litere++;
else if((y>='a' && y<='z') || (y>='A' && y<='Z'))
cuvinte++;
y=x;
}
fout<<litere/cuvinte;
}
int main()
{
string text;
fin>>text;
rezolva(text);
return 0;
}