Cod sursa(job #1189307)
Utilizator | Data | 22 mai 2014 10:46:28 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
#define inFile "text.in"
#define outFile "text.out"
using namespace std;
int main()
{
char c;
int nrC=0,nrL=0,nou=0;
ifstream fin(inFile);
while(!fin.eof())
{
fin.get(c);
if(c>=65 && c<=90 || c>=97 && c<=122) {nrL++; nou++;}
else{if(nou) nrC++; nou=0;}
}
fin.close();
ofstream fout(outFile);
fout<<nrL/nrC;
fout.close();
}