Cod sursa(job #1577607)
| Utilizator | Data | 23 ianuarie 2016 16:39:59 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#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;
f.getline(s,1000);
int i,k=0,m=0,z;
for (i=0;i<strlen(s);i++)
{
if (((s[i]<='a')&&(s[i]>='z'))||((s[i]<='A')&&(s[i]>='Z')));
m++;
}
p=strtok(s,sep);
while (p)
{
k++;
p=strtok(NULL,sep);
}
z=m/k;
g<<z;
g.close();
}
