Pagini recente » Cod sursa (job #1860702) | Cod sursa (job #1062103) | Cod sursa (job #112953) | Cod sursa (job #837655) | Cod sursa (job #805779)
Cod sursa(job #805779)
#include<iostream>
#include<string.h>
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char text[100],*p,sep[]=" ?.!-";
int lungime=0,nrcuv=0,i=0;
f.get(text,100);
p=text;
while (*p)
{
for(i=0;i<=strlen(sep);i++)
if(*p==sep[i])
nrcuv++;
if((int(*p)>64&&int(*p)<91)||(int(*p)>96&&int(*p)<127))
lungime++;
p++;
}
g<<lungime/nrcuv;
f.close();
return 0;
}