Cod sursa(job #1697175)
Utilizator | Data | 30 aprilie 2016 21:47:51 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.56 kb |
#include <fstream>
#include <string>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
int nrc=0,nrl=0;
bool da;
char x;
//in.getline(s,1048599,'\n');
while(in.get(x))
{
if((x>=65 && x<=90) || (x>=97 && x<=122))
{
nrl++;
da=1;
}
else
{
if(da)
nrc++;
da=0;
}
}
nrl=nrl/nrc;
out<<nrl<<"\n";
out.close();
return 0;
}