Pagini recente » Cod sursa (job #1997538) | Cod sursa (job #1284370) | Cod sursa (job #674747) | Istoria paginii utilizator/denyroman | Cod sursa (job #2383896)
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
long long litere, cuvinte;
char x, y;
string text;
void rezolva(string a)
{
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()
{
fin>>text;
rezolva(text);
return 0;
}