Skip to content

Instantly share code, notes, and snippets.

@rhysd
Created May 12, 2012 20:30
Show Gist options
  • Save rhysd/2668827 to your computer and use it in GitHub Desktop.
Save rhysd/2668827 to your computer and use it in GitHub Desktop.
class Main{
public static void main(String[] args){
int max = 1000;
int total = 0;
int i;
i = 3;
while(i<max){
total += i;
i += 3;
}
i = 5;
while(i<max){
total += i;
i += 5;
}
System.out.println(total);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment