Cod sursa(job #2068957)
Utilizator | Data | 18 noiembrie 2017 11:40:55 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char s[256];
int n,nrc=0,nrl=0,i;
f.getline(s,256);
n=strlen(s);
for(i=0;i<n-1;i++)
{
if(isalpha(s[i]))
{
nrl++;
if(strchr(".,-:;!? ",s[i+1]))
nrc++;
}
}
g<<nrl/nrc;
return 0;
}