Cod sursa(job #2413480)
| Utilizator | Data | 23 aprilie 2019 14:08:46 | |
|---|---|---|---|
| Problema | Text | Scor | 50 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 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 = 1, nrr = 0;
int main() {
bool ok = false;
while(in.get(c)){
int sr = c;
if ((sr <= 89 && sr >= 65) || (sr <= 122 && sr >= 97) || (sr <= 57 && sr >= 48)) {
nrr++;
ok = true;
}
if (sr == 32 || sr == 45) {
if (ok == true) {
nr++;
ok = false;
}
}
}
out << floor(nrr / nr);
}
