Cod sursa(job #2615947)
Utilizator | Data | 15 mai 2020 21:27:38 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
char ch;
int main()
{
int nr=0,lung=0,ok=0;
while(cin.get(ch))
{
if((ch>='a' and ch<='z') or (ch>='A' and ch<='Z'))
{
if(ok==0)
{
++nr;
ok=1;
}
++lung;
}
else ok=0;
}
if(nr==0) cout<<0;
else cout<<lung/nr;
return 0;
}