Cod sursa(job #2581483)
| Utilizator | Data | 15 martie 2020 13:13:21 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
string s;
int nrcuv,lung;
int main()
{
int i=0,sz=s.size();
while (fin>>s)
{
int i=0,sz=s.size();
while (i<sz)
{
while (isalpha(s[i])==0 && i<sz)
i++;
if (isalpha(s[i])!=0)
nrcuv++;
while (isalpha(s[i])!=0 && i<sz)
{
lung++;
i++;
}
}
}
fout<<lung/nrcuv;
return 0;
}
