Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Rasti visus 3- lius sveikus skaičius, kurie yra lygūs savo skaitmenų sumos kvadratui.
- sum=0
- for i in 100..999
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement