Pagini recente » Cod sursa (job #3247907) | Cod sursa (job #1184697) | Borderou de evaluare (job #725590) | Cod sursa (job #633952) | Cod sursa (job #779283)
Cod sursa(job #779283)
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
void text()
{
char c;
int litere = 0,cuvinte = 0;
while(f>>c)
{
if((c >= 65 && c <= 90) || (c >= 97 && c <= 122))litere++;
else
if(c == ' ' || c == ',')
cuvinte++;
}
g<<litere/cuvinte<<'\n';
}
int main()
{
text();
g.close();
return 0;
}