Pagini recente » Cod sursa (job #2904729) | Cod sursa (job #2172929) | Cod sursa (job #2307150) | Cod sursa (job #2723829) | Cod sursa (job #2383897)
#include <fstream>
#include <cstring>
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;
}