Cod sursa(job #2029817)

Utilizator Bog_Sav01Bogdan Sava Bog_Sav01 Data 30 septembrie 2017 14:56:48
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <iostream>
#include <fstream>
#include <ctype.h>
using namespace std;

int main()
{
    ifstream in("text.in");
    ofstream out("text.out");
    int k=0,k1=0,j,i;
    string str;
    getline(in,str);
    for (i=0; i<str.length(); i++)
    {
        if(isalpha(str.at(i)))
        {
        k1++;
        while(isalpha(str.at(i)))
        {k++;i++;}
        }
    }
    out<<k/k1;
    return 0;
}