Posted By

cmm7825 on 05/20/10


Tagged


Versions (?)

Problem 1


 / Published in: Ruby
 

  1. #!/usr/bin/ruby
  2. $sum = 0;
  3.  
  4. for i in 1..999
  5. if(i % 3 == 0 || i % 5 == 0)
  6. $sum = $sum + i;
  7. end
  8. end
  9.  
  10. puts $sum;

Report this snippet  

You need to login to post a comment.