Pagini recente » Cod sursa (job #2845829) | Cod sursa (job #2707485) | Cod sursa (job #3143894) | Cod sursa (job #971001) | Cod sursa (job #1579357)
#include <fstream>
#include <iostream>
#include <string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{char a[1000];
int nr=0,litere=0,k;
while(!fin.eof())
{fin>>a;
nr++;
k=strlen(a);
for(int i=1;i<=strlen(a);i++)
{if(a[i]=='!'||a[i]=='?'||a[i]=='.'||a[i]==','||a[i]=='-'||a[i]==':'||a[i]=='"'||a[i]=='/'||a[i]=='<'||a[i]=='>'||a[i]=='_') k--;
}
litere=litere+k;
}
fout<<litere/nr;
return 0;
}