Cod sursa(job #2534194)
Utilizator | Data | 30 ianuarie 2020 10:42:56 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
int main ()
{
char ch;
int lung = 0;
int cuv = 0;
char lastCh = '\0';
while(fin >> noskipws >> ch)
{
if(isalpha(ch))
{
lung++;
if(!isalpha(lastCh))
cuv++;
}
lastCh = ch;
}
fout << lung / cuv;
}