Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "Iveskite skaiciu "
- sk=gets.to_i
- x=sk
- k=0
- suma=0
- while(x!=0)
- s=x%10
- kv=s*s
- if(kv%2==0)
- suma=suma+s
- k=k+1
- end
- x=x/10
- end
- puts "Viso tokiu skaitmenu skaiciuje #{sk} yra: #{k}"
- puts "Siu skaitmenu suma: #{suma}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement