Advertisement
ErolKZ

Untitled

Jul 13th, 2021
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. function solve(input) {
  2.  
  3. let a1 = Number(input[0]);
  4.  
  5. let a2 = Number(input[1]);
  6.  
  7. let n = Number(input[2]);
  8.  
  9.  
  10. let symbol1 = '';
  11.  
  12. let symbol2 = 0;
  13.  
  14. let symbol3 = 0;
  15.  
  16. let symbol4 = 0;
  17.  
  18. let sumOfSymbols = 0;
  19.  
  20. let division = n / 2 - 1;
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. for (let i = a1; i < a2; i++) {
  29.  
  30.  
  31.  
  32.  
  33. symbol1 = String.fromCharCode(i);
  34.  
  35.  
  36. for (let j = 1; j < n; j++) {
  37.  
  38.  
  39.  
  40.  
  41.  
  42. symbol2 = j;
  43.  
  44.  
  45. for (let k = 1; k <= division; k++) {
  46.  
  47.  
  48.  
  49.  
  50. symbol3 = k;
  51.  
  52. symbol4 = symbol1.charCodeAt();
  53.  
  54. sumOfSymbols = symbol2 + symbol3 + symbol4;
  55.  
  56. if (sumOfSymbols % 2 !== 0 && symbol4 % 2 !== 0) {
  57.  
  58. console.log(`${symbol1}-${symbol2}${symbol3}${symbol4}`);
  59.  
  60.  
  61.  
  62. }
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. }
  70.  
  71.  
  72.  
  73.  
  74. }
  75.  
  76.  
  77.  
  78.  
  79.  
  80. }
  81.  
  82.  
  83.  
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement