#include <iostream>
#include <array>
int main()
{
std::array<unsigned int, 3> arr;
short int result{0};
for(auto& i : arr)
std::cin >> i;
if(arr[0] == arr[1])
result++;
if(arr[0] == arr[2])
if(arr[1] == arr[2])
std::cout << ((result == 0 || result == 3) ? (result) : (++result)) << std::endl;
return 0;
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
#include <array>
int main()
{
std::array<unsigned int, 3> arr;
short int result{0};
for(auto& i : arr)
std::cin >> i;
if(arr[0] == arr[1])
result++;
if(arr[0] == arr[2])
result++;
if(arr[1] == arr[2])
result++;
std::cout << ((result == 0 || result == 3) ? (result) : (++result)) << std::endl;
return 0;
}