Pagini recente » Cod sursa (job #1055755) | Cod sursa (job #2863824) | Statistici Ruxandra Stoica (Ruxi_203) | Cod sursa (job #2272512) | Cod sursa (job #1326472)
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char st[1001];
int nrcuv=0,nrc=0;
f.get(st,1000);
for(int i=1;i<=strlen(st);i++)
{
if(i!=strlen(st))
if(((st[i]==' ')||(st[i]==45))&&((((st[i-1]>=65)&&(st[i-1]<=90))||((st[i-1]>=97)&&(st[i-1]<=122)))||(((st[i+1]>=65)&&(st[i+1]<=90))||((st[i+1]>=97)&&(st[i+1]<=122)))))
nrcuv++;
if(((st[i]>=65)&&(st[i]<=90))||((st[i]>=97)&&(st[i]<=122)))
nrc++;
}
f.close();
g << nrc/nrcuv;
g.close();
return 0;
}