Cod sursa(job #2216169)
Utilizator | Data | 25 iunie 2018 18:23:01 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <cstring>
using namespace std;
#include <fstream>
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char s[5001],*p,sep[]=",. !?-:;'";
int suma=0,nr=0;
f.get(s,5000);
for(int i=0;i<strlen(s)-1;i++)
if(isalpha(s[i]))
{
suma++;
if(!(isalpha(s[i+1])))
nr++;
}
g<<suma/nr;
f.close();
g.close();
return 0;
}