Pagini recente » Istoria paginii runda/oji2014 | Cod sursa (job #1449756) | Cod sursa (job #1463654) | Cod sursa (job #1384836) | Cod sursa (job #1577575)
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream f ("text.in");
ofstream g ("text.out");
char s[1000],sep[]=" .,?!`~*)(",*p,l[]="qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM";
f.getline(s,1000);
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();
}