aboutsummaryrefslogtreecommitdiff
path: root/week03/exercise05.cpp
blob: 0facfdbddc492fefd44fb2c340eca9f975243f7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>

int main() {
	int countLower = 0, countUpper = 0, countDigit = 0;
	char input;
	std::cin >> input;
	while (input != '$') {
		if (input == '@') {
			return 0;
		}
		// Грешка ли е, че тук има "if" вместо "else if"?
		if ('a' <= input && input <= 'z') {
			countLower++;
		}
		else if ('A' <= input && input <= 'Z') {
			countUpper++;
		}
		else if ('0' <= input && input <= '9') {
			countDigit++;
		}
		std::cin >> input;
	}
	std::cout << "Lowercase: " << countLower << " Uppercase: " << countUpper << " Digit: " << countDigit << std::endl;
}