Preview:
#include <iostream>

using namespace std;

int main() {
  
 int a, b, c, d;
  cout<< "Введите 4 пин кода\n";
  
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
  
   while (a+b+c+d !=42){std::cout << " Ввод некорректный, попробуйте еще раз\n";
     
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
     
   }
   std::cout << " Ввод коректный\n"; 
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter