Cod sursa(job #1599393)
Utilizator | Data | 13 februarie 2016 20:36:36 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<fstream>
#include<string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char s[400], sep[]=" ,!?\n;.:";
int nrc=0, i=0, k=0;
fin.get(s, 400);
while(i<strlen(s))
{
if(s[i]>=65 && s[i]<=122) nrc++;
i++;
}
char *p=strtok (s, sep);
while (p)
{
k++;
p=strtok(NULL,sep);
}
fout<<int(nrc/k);
}