Cod sursa(job #1152855)

Utilizator bt.panteaPantea Beniamin bt.pantea Data 25 martie 2014 00:05:34
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <fstream>
#include <iostream>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
long long i,k,c,sw;
char s,ch;
int main()
{
    while (f.get(s))
    {
        if ((s>='A'&&s<='Z')||(s>='a'&&s<='z')) k++;
        else if ((ch>='A'&&ch<='Z')||(ch>='a'&&ch<='z')) c++;
        ch=s;
    }
    if ((s>='A'&&s<='Z')||(s>='a'&&s<='z')) c++;
    if (c!=0) g<<k/c;
    else g<<0;

    return 0;
}