Mai intai trebuie sa te autentifici.
Cod sursa(job #2760112)
| Utilizator | Data | 23 iunie 2021 05:06:29 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.71 kb |
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
int litere = 0, cuv = 0;
bool OK = false;
string s;
while(in >> s)
{
OK = false;
for (int i = 0; i < s.size(); i++)
if ((s[i] >= 'a' && s[i] <= 'z') ||
(s[i] >= 'A' && s[i] <= 'Z'))
{
litere++;
if (OK == false)
{
OK = true;
cuv++;
}
}
else
{
OK = false;
}
}
out << litere / cuv;
return 0;
}
