/ Published in: Ruby
Expand |
Embed | Plain Text
#!/usr/bin/ruby $sum = 0; for i in 1..999 if(i % 3 == 0 || i % 5 == 0) $sum = $sum + i; end end puts $sum;
You need to login to post a comment.
#!/usr/bin/ruby $sum = 0; for i in 1..999 if(i % 3 == 0 || i % 5 == 0) $sum = $sum + i; end end puts $sum;
You need to login to post a comment.