SHARE
TWEET

carré de la somme des chiffres d'un nombre

roronoa Jul 17th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Auto-generated code below aims at helping you parse
  3.  * the standard input according to the problem statement.
  4.  **/
  5.  
  6. const number = (readline());
  7.  
  8. // Write an action using console.log()
  9. // To debug: console.error('Debug messages...');
  10.  
  11. console.log(number.split('').map(a=>1*a).reduce((a,b)=>a+b,0)**2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top