Cod sursa(job #2558841)
Utilizator | Data | 26 februarie 2020 20:33:22 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
string s;
int lgt,nrcv;
int main()
{
getline(f,s);
int n=s.size();
for(int i=0;i<n;i++)
{
if(isalpha(s[i]))
{
while(isalpha(s[i]))
{
i++;
lgt++;
}
nrcv++;
}
}
if(nrcv==0)
nrcv++;
g<<lgt/nrcv;
return 0;
}