Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sum=0
- for i in 100..9999
- n=i
- while n>0
- a=n%10
- b=n/10
- n=n/10
- sum=sum+a
- end
- d=sum*sum
- if i==d then
- puts "#{i} "
- end
- end
- puts "pabaiga"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement