Pagini recente » Cod sursa (job #806929) | Cod sursa (job #1168658) | Cod sursa (job #2895613) | Cod sursa (job #837593) | Cod sursa (job #1419514)
#include <iostream>
#include <fstream>
using namespace std;
char c,v[1000];
int nr,l,i,n,a,b,k;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while (f.get(c))
{
n++;
v[n]=c;
if ((((c>=97) and (c<=122)) or ((c>=65) and (c<=90))) and (k==0)) {a=n;k=1;}
else if ((((c>=97) and (c<=122)) or ((c>=65) and (c<=90))) and (k==1)) b=n;
}
for (i=a;i<=b;i++)
{
if (((v[i]>=97) and (v[i]<=122)) or ((v[i]>=65) and (v[i]<=90))) l++;
else nr++;
}
g<<l/nr;
return 0;
}