Cod sursa(job #2595929)
| Utilizator | Data | 8 aprilie 2020 18:03:41 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include<fstream>
#include <iostream>
#include<string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int aux=0,c=0, lm=0;
char a;
bool cuv = false;
while (fin>> noskipws>> a) {
if ((a <= 90 && a >= 65) || (a >= 97 && a <= 122)) {
cuv = true;
aux++;
}
else {
if (cuv) {
c++;
}
cuv = false;
}
}
lm = aux / c;
fout << lm<<" ";
cout << aux<<" ";
cout << c<<" ";
return 0;
}