Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import 'dart:math';
  2.  
  3. void main(){
  4.  
  5. double numero=153; //Armstrong numbers = 153, 370, 371, 407
  6. double dig=1;
  7. double dig2=5;
  8. double dig3=3;
  9.  
  10. double conta=dig*dig*dig;
  11. double conta2=dig2*dig2*dig2;
  12. double conta3=dig3*dig3*dig3;
  13.  
  14. double end=conta+conta2+conta3;
  15.  
  16. String yes="It is an armstrong number";
  17. String not="It is not an armstrong number";
  18.  
  19. bool menor;
  20. menor=numero<10;
  21. if (menor){
  22. print(yes);
  23. }
  24.  
  25. bool vdd; //3 Digitos
  26. vdd=numero==end;
  27.  
  28.  
  29.  
  30. if (vdd){
  31. print(yes);
  32. }else
  33. print(not);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement