Professional Documents
Culture Documents
To Change This License Header
To Change This License Header
*/
package tugasscaling;
import java.io.*;
import java.lang.*;
/**
* @author oetan
*/
int n,temp;
String temp1;
System.out.println("Enter Elements");
n=Integer.parseInt(in.readLine());
System.out.println("Enter elements");
for(int i=0;i<n;i++)
clust1[i]=in.readLine();
clust2[i]=Integer.parseInt(in.readLine());
for(int j=0;j<n;j++)
{
for(int k=0;k<n;k++)
if(clust2[j]<clust2[k])
temp=clust2[j];
clust2[j]=clust2[k];
clust2[k]=temp;
temp1=clust1[j];
clust1[j]=clust1[k];
clust1[k]=temp1;
op.display(clust1,clust2,n);
for(int i=0;i<n-1;i++)
clust1[0]=clust1[0]+clust1[i+1];
clust2[0]=clust2[0]+clust2[i+1];
clust1[i+1]="0";
op.display(clust1,clust2,n);
class operation
System.out.println("variable\tvalue");
for(int i=0;i<n;i++)
if(clust1[i]!="0")
System.out.println(clust1[i]+"\t\t"+clust2[i]);
System.out.println("");