Cod sursa(job #2407528)

Utilizator BossBobsterRobert Alexandru Costin BossBobster Data 16 aprilie 2019 22:29:13
Problema Text Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <iostream>
#include <fstream>
using namespace std;

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

int main()
{
    int tot1 = 0, tot2 = 0;
    string s;
    fin >> s;
    for(int i = 0; i < s.length(); i ++)
    {
        if(s[i] >= 'A' && s[i] <= 'z')
            tot1 ++;
        if(s[i] == ' ')
            tot2 ++;
    }
    fout << tot1 / (tot2 + 1);
}