Cod sursa(job #2630344)
Utilizator | Data | 25 iunie 2020 13:36:32 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int s=0,nr=0;
char val;
bool first=true;
while(fin.get(val))
{
if(isalpha(val))
{
s++;
if(first == true)
{
nr++;
first = false;
}
}
else
{
first = true;
}
}
fout<<s/nr;
return 0;
}