Cod sursa(job #2278953)
| Utilizator | Data | 8 noiembrie 2018 19:01:51 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char text[10];
long i = 0, y = 0, cuv = 0, lit = 0;
ifstream f("text.in");
ofstream g("text.out");
while (f)
{
text[i % 10] = f.get();
if (text[i % 10] >= 'A' && text[i % 10] <= 'z')
y++;
else if (y != 0)
{
cout << y<<' ';
cuv++;
lit += y;
y = 0;
}
i++;
}
if (y != 0) {
cuv++;
lit += y;
}
g << lit / cuv;
f.close();
g.close();
}
