Cod sursa(job #2220104)
| Utilizator | Data | 10 iulie 2018 16:13:48 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream in;
in.open("text.txt");
ofstream out;
out.open("tex.txt");
int nr = 0,nr_cuv = 0,ant = 0;
char p;
while (in.get(p)){
int aux = (int)p;
if((aux > 64 && aux <91) || (aux > 96 && aux <123)){
nr++;
if(ant < 65 || ant >122 || (ant >90 && ant <97)) nr_cuv++;
}
ant = aux;
}
out << nr / nr_cuv <<endl;
return 0;
}
