Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:math';
- void main(){
- double numero=153; //Armstrong numbers = 153, 370, 371, 407
- double dig=1;
- double dig2=5;
- double dig3=3;
- double conta=dig*dig*dig;
- double conta2=dig2*dig2*dig2;
- double conta3=dig3*dig3*dig3;
- double end=conta+conta2+conta3;
- String yes="It is an armstrong number";
- String not="It is not an armstrong number";
- bool menor;
- menor=numero<10;
- if (menor){
- print(yes);
- }
- bool vdd; //3 Digitos
- vdd=numero==end;
- if (vdd){
- print(yes);
- }else
- print(not);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement