fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, c, x;
  6. cin >> a >> b >> c >> x;
  7. int x_copy = 0;
  8. int c_copy = x;
  9. int cnt = 0;
  10. while (x > 0) {
  11. ++cnt;
  12. x_copy = x;
  13. x /= 10;
  14.  
  15. }
  16. cout << x;
  17. // if ((c == c_copy % 10) && b == x_copy && a == cnt) {
  18. // cout << "DA";
  19. // } else {
  20. // cout <<"NU";
  21. // }
  22. return 0;
  23. }
  24.  
  25. /* Teste:
  26.  
  27. Valori minime
  28.  
  29. 3 1 2 102 -> DA
  30.  
  31. 1 3 2 123 -> NU
  32.  
  33. Valori maxime
  34.  
  35. 9 9 9 900000009 -> DA
  36.  
  37. 9 9 9 90000009 -> NU
  38.  
  39. 9 8 7 987654321 -> NU
  40.  
  41. Numere cu toate cifrele egale
  42.  
  43. 4 4 4 4444 -> DA
  44.  
  45. 7 7 7 7777777 -> DA
  46.  
  47. 8 8 8 888888 -> NU
  48.  
  49. Numere cu toate cifrele distincte
  50.  
  51. 4 4 1 4321 -> DA
  52.  
  53. 7 5 1 7451 -> NU
  54.  
  55.  
  56.  
  57. Numere cu doua cifre identice
  58.  
  59. 4 8 8 8458 -> DA
  60.  
  61. 5 5 6 59796 -> DA
  62.  
  63. Numere cu trei cifre identice
  64.  
  65. 3 3 3 333 -> DA
  66.  
  67. 4 6 8 6888 -> DA */
Success #stdin #stdout 0s 5324KB
stdin
3 1 2 102
stdout
Standard output is empty