Cod sursa(job #1972175)

Utilizator MikeStrikeAgache Mihai MikeStrike Data 22 aprilie 2017 12:54:56
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <fstream>
#include <string.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");

int main()
{   char sir[256],alfa[]="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
   int k=0,i,c=0;
   in.get(sir,256);
for(i=0;i<strlen(sir);i++)
    if(strchr(alfa,sir[i])) k++;
	for(i = 0; sir[i] != '\0'; i++)
	{
		if (sir[i] == ' ')
		{
			c++;
		}
	}

out<<k/(c+1);

}