Cod sursa(job #3369106)
| Utilizator | Data | 17 octombrie 2026 12:28:03 | |
|---|---|---|---|
| Problema | Text | Scor | 50 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <fstream>
std::ifstream fin("text.in");
std::ofstream fout("text.out");
int main()
{
char C;
int NrLitere=0;
int NrCuvinte = 0;
while ((C=fin.get())&&C!=EOF)
{
if ((C<='z'&&C>='a')||(C<='Z'&&C>='A'))
{
NrLitere++;
}
if (C==' ')
{
NrCuvinte++;
}
}
if (C!=' ') NrCuvinte++;
fout << NrLitere/NrCuvinte;
}
