Cod sursa(job #1152852)

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

    return 0;
}