Cod sursa(job #1580230)
Utilizator | Data | 25 ianuarie 2016 18:00:05 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
fstream f("text.in");
ofstream g("text.out");
char a[100000],sep[]=".,!?1234567890;- ";
int i,k=0,x=0;
f.getline(a,100000);
int n=strlen(a);
for(i=0;i<n;i++)
if(!strchr(sep,a[i]))k++;
for(i=0;i<n;i++)
if(!strchr(sep,a[i])){while(!strchr(sep,a[i]))
i++;
x++;
}
g<<k/x;
g.close();
}