Pagini recente » Cod sursa (job #1638936) | Cod sursa (job #1909697) | Cod sursa (job #1139834) | Cod sursa (job #2469636) | Cod sursa (job #1098666)
// text.in.cpp : Defines the entry point for the console application.
//
#include<fstream>
#include<string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char sir[256], tok[] = " ,.:;!?-",*q, *b;
int sum, k,i;
int litera(char s)
{
if (('a' <= s&&s <= 'z') || ('A' <= s&&s <= 'Z'))
return 1;
return 0;
}
int main()
{
fin.get(sir, 255);
for (i = 0; sir[i];i++)
if (litera(sir[i]))
k++;
q = strtok(sir,tok);
while (q)
{
sum++;
q = strtok(NULL, tok);
}
fout << k / sum;
return 0;
}