Cod sursa(job #2414167)
Utilizator | Data | 24 aprilie 2019 11:27:24 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <string.h>
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char c;
int nr, nrr;
int main() {
bool ok;
while (in.get(c)) {
if ((c <= 'z' && c >= 'a') || (c <= 'Z' && c >= 'A')) {
if (ok == false) {
ok = true;
nr++;
}
nrr++;
}
else {
ok = false;
}
}
out << nrr / nr;
}