Pagini recente » Cod sursa (job #1154065) | Cod sursa (job #1375309) | Cod sursa (job #1964202) | Cod sursa (job #2644493) | Cod sursa (job #1577578)
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream f ("text.in");
ofstream g ("text.out");
char s[10000],sep[]=" .,?!`~*)(",*p,l[]="qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM";
f.getline(s,10000);
int i,k=0,m=0;
p=strtok(s,sep);
while (p)
{
k++;
for (i=0;i<strlen(p);i++)
{
if (strchr(l,p[i]));
m++;
}
p=strtok(NULL,sep);
}
g<<m/k;
g.close();
}