Skip to content

Instantly share code, notes, and snippets.

@Nucleareal
Created August 28, 2013 13:21
Show Gist options
  • Save Nucleareal/6365996 to your computer and use it in GitHub Desktop.
Save Nucleareal/6365996 to your computer and use it in GitHub Desktop.
メイン部分だけ
{
List<Integer> plist = new LinkedList<Integer>();
for(int i = 2; i < MAX; i++)
{
boolean isPrime = true;
for(Integer ing : plist)
{
if(i*i > ing.intValue()) break;
if(i % ing.intValue() == 0) { isPrime = false; break; }
}
if(isPrime)
{
plist.add(Integer.valueOf(i));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment