Click to See Complete Forum and Search --> : ignore this


davey
01-03-2005, 06:39 AM
public class sort3digit {
public sort3digit() {
}
public static void main(String[] args) {
int threed=0,temp;
int[] threeda;
System.out.print("Please enter a 3 digit number to be sorted: ");
threed=Keyboard.readInt();
while(threed<100 || threed>999){
System.out.print("The number cannot start with 0 or have more than 3 digits: ");
threed=Keyboard.readInt();
}
threeda = new int[4];
threeda[1] = threed/100;
threeda[2] = threed/10 - (threeda[1]*10);
threeda[3] = threed - (threeda[1]*100) - (threeda[2]*10);
for(int x=1;x<3;x++){
for(int i=1;i<3;i++){
if(threeda[i+1]>threeda[i]){
temp=threeda[i+1];
threeda[i+1]=threeda[i];
threeda[i]=temp;
temp=0;
}
}
}
System.out.print("\n"+threeda[1]+""+threeda[2]+""+threeda[3]);

}
}





(this is just to get my code to school)

buntine
01-03-2005, 08:47 AM
I dont think so, buddy.:eek: There are several other methods of transporting data. (eg. email!, floppy disk)

I cant speak for the other mods, though, I will leave this here simply so you can see my post. Please dont do this again. Its a waste of resources.

Regards,
Andrew Buntine.

Khalid Ali
01-03-2005, 09:32 AM
I totally agree with buntine, please do not not abuse your privileges to post in these forums that are meant to help those whe actually seek help...

davey
01-03-2005, 09:40 AM
my school is strict about email and floppy disks and junk like that