Cod sursa(job #2460489)
| Utilizator | Data | 23 septembrie 2019 19:44:49 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.73 kb |
#include <fstream>
#include <cstring>
#include <string>
#include <cctype>
#define input "text.in"
#define output "text.out"
using namespace std;
ifstream in(input);
ofstream out(output);
void Solve()
{
int cuvinte = 0, litere = 0; bool cuv = false;
char mesaj;
while(in.get(mesaj))
if(cuv == false)
{
if(isalpha(mesaj))
{
cuvinte++;
cuv = true;
litere++;
}
}
else
{
if(isalpha(mesaj))
{
litere++;
}
else cuv = false;
}
out << litere / cuvinte;
}
int main()
{
Solve();
return 0;
}
