Cod sursa(job #1821510)

Utilizator mariastStoichitescu Maria mariast Data 3 decembrie 2016 11:29:16
Problema Text Scor 100
Compilator cpp Status done
Runda x_test2 Marime 0.46 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int i,k,m,nr,n,ok;
char c,vec[]="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
int main()
{
     while(f.get(c)){
        if(strchr(vec,c)==0){
            if(ok){
                ok=0;
                nr++;
            }

        }
        else{
            ok=1;
            m++;
        }
    }
    if(nr>0)g<<m/nr;
    else g<<0;
}