Pagini recente » Borderou de evaluare (job #117923) | Borderou de evaluare (job #118032) | Borderou de evaluare (job #289312) | Borderou de evaluare (job #117777) | Cod sursa (job #641802)
Cod sursa(job #641802)
#include<fstream>
#include<string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main ()
{
char text[1000];
f.get(text,100);
char car[]=" ,!?.";
int nrcuv=0,litere=0;
int n=strlen(text);
for(int i=0;i<n;i++)
{
if (strchr(" ",text[i]))
nrcuv++;
if(strchr("-",text[i]))
nrcuv++;
if(isalpha(text[i]))
litere++;
}
g<<litere/(nrcuv-1);
return 0;
}