Cod sursa(job #1588008)

Utilizator ruxandramateiMatei Ruxandra ruxandramatei Data 2 februarie 2016 18:46:59
Problema Text Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.57 kb
#include <iostream>
#include <fstream>

using namespace std;

ifstream in("text.in");
ofstream out("text.out");

int main(){
    char s[1000],c;
    int l=0,k=0,p=0,ok=0;

    while(!in.eof()){
        in.get(c);
        ok=0;
        if((c>='a'&& c<='z')||(c>='A'&&c<='Z')){
          ok=1;
          k++;
        }
        while(!in.eof()&&(c>=65&& c<=90)||(c>=97&&c<=122)){

            in.get(c);
            k++;
        }
        if(ok==1)p++;
        while(!in.eof()&&(c<65||(c>90&&c<97)||c>122)){
              in.get(c);
            }
    }
    out<<k/p;
    return 0;
}