Cod sursa(job #1747069)

Utilizator cyprcCristea Ciprian - Raul cyprc Data 24 august 2016 14:43:16
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<fstream>

int main()
{
	std::ifstream f("text.in");
	std::ofstream g("text.out");
	char c;
	int lt=0, nc=0;
	int ok = 0;
	while (f>>std::noskipws>>c)
	{
		if(c >= 'a' && c <= 'z')
		{
			lt++;
			ok = 1;
			continue;
		}
		if (c >= 'A' && c <= 'Z')
		{
			lt++;
			ok = 1;
			continue;
		}

		if (ok == 1)
		{
			++nc;
			ok = 0;
		}
	}
	g << nc;
	f.close();
	g.close();
	return 0;
}