Cod sursa(job #1577631)
| Utilizator | Data | 23 ianuarie 2016 17:00:32 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream f ("text.in");
ofstream g ("text.out");
char sep[]=" .,:;?!",*p;
char s[1000000];
f.getline(s,1000);
int i,k=0,m=0,z;
p=strtok(s,sep);
while (p)
{
k++;
for (i=0;i<strlen(p);i++)
{
if (((p[i]<='a')&&(p[i]>='z'))||((p[i]<='A')&&(p[i]>='Z')));
m++;
}
p=strtok(NULL,sep);
}
z=m/k;
g<<z;
g.close();
}
