Cod sursa(job #1288683)

Utilizator AndreiPopescu999Andrei Popescu AndreiPopescu999 Data 8 decembrie 2014 23:22:14
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");

int main()
{
char c;
int nrc=0,nrt=0,n=0;
while(!fin.eof())
    {fin.get(c);
     if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
        {nrt++;
        n++;
        }
     else
        {if(n)
            nrc++;
        n=0;
        }
    }
fout<<nrt/nrc;
 
return 0;
}