Pagini recente » Cod sursa (job #2961415) | Cod sursa (job #1643113) | Cod sursa (job #595033) | Cod sursa (job #2538593) | Cod sursa (job #761188)
Cod sursa(job #761188)
#include <fstream>
#include <string>
using namespace std;
string c;
unsigned cuv, lcuv;
bool ok=true;
fstream f;
int main()
{
f.open("text.in", ios::in);
getline(f, c, '\0');
f.close();
f.clear();
for(int i=0; i<c.length(); i++)
{
if(c[i]>='A' && c[i]<='z')
{
lcuv++;
if(ok)
cuv++;
ok=false;
}
else
ok=true;
}
f.open("text.out", ios::out);
f << lcuv/cuv;
f.close();
}