Cod sursa(job #2630343)
| Utilizator | Data | 25 iunie 2020 13:35:04 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
string text;
getline(fin, text);
int i=0,s=0,nr=0;
bool first=true;
while(i<text.length())
{
if(isalpha(text[i]))
{
s++;
if(first == true)
{
nr++;
first = false;
}
}
else
{
first = true;
}
i++;
}
fout<<s/nr;
return 0;
}
