Cod sursa(job #1256794)

Utilizator AndyCatrunaCatruna Andy AndyCatruna Data 6 noiembrie 2014 21:13:56
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int ok,nr2,nr1;
char x;
int main(){
    while(fin.get(x)){
         if (ok==0){
            if ((x>='a' && x<='z') || (x>='A'&&x<='Z')){
                ok=1;
            }
         }
         if(ok==1){
            if ((x>='a' && x<='z') || (x>='A'&&x<='Z')){
                nr1++;
            }
            else {
                nr2++;
                ok=0;
            }
        }

     }
     fout<<nr1/nr2;

    return 0;
}