思考:
將烏龜以重量來做排序.由小排到大.
目前分類:Some Code (5)
- May 12 Wed 2010 19:58
#UVA 10154 Weights and Measures(烏龜塔)
- Apr 06 Tue 2010 08:13
#UVA 11268 Reliable Network
#include
#include
- Mar 22 Mon 2010 12:49
#(JAVA_Applet) 最大公因數
import java.io.*;
import javax.swing.*;
import javax.swing.*;
- Mar 22 Mon 2010 12:42
#(JAVA_Applet) 最大質數
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.util.Scanner;
public class hw4 extends java.applet.Applet {
public void init() {Scanner scanner=new Scanner(System.in);
String a=JOptionPane.showInputDialog(null,"請輸入一數值:");
int input=Integer.parseInt(a); int temp=0;
System.out.print(input+" 以下的質數有:\n");
for(int i=2;i
{
boolean isPrime=true;
for(int j=2;j
{
if(i%j==0)
{
isPrime=false;
break;
}
}
if(isPrime){temp=i;continue;}
}
JOptionPane.showMessageDialog(null,"最大值數為:"+temp+" ");
}
}
import javax.swing.*;
import java.awt.*;
import java.util.Scanner;
public class hw4 extends java.applet.Applet {
public void init() {Scanner scanner=new Scanner(System.in);
String a=JOptionPane.showInputDialog(null,"請輸入一數值:");
int input=Integer.parseInt(a); int temp=0;
System.out.print(input+" 以下的質數有:\n");
for(int i=2;i
{
boolean isPrime=true;
for(int j=2;j
{
if(i%j==0)
{
isPrime=false;
break;
}
}
if(isPrime){temp=i;continue;}
}
JOptionPane.showMessageDialog(null,"最大值數為:"+temp+" ");
}
}
- Mar 18 Thu 2010 21:23
#UVA 100 3n+1 Problem