アットウィキロゴ

pろ0301

import java.awt.*;
import java.awt.event.*;

class tax0301 extends Frame{

int s;
double pxs,cxs,cost;
double th[]=new double[101];
double x[]=new double[101];

public static void main(String [] args) {
        Frame f=new tax0301();
        f.setTitle("tax0301");
        f.setSize(700,700);
        f.setBackground(Color.yellow);
        f.setVisible(true);
    }

tax0301(){

for(s=1;s<101;s++){
th[s]=s;
}

cost=10;

op();

for(s=1;s<101;s++){
System.out.println(d(th[s],pxs,cxs));
}

addWindowListener(new stopwin());
}


class stopwin extends WindowAdapter{
    public void windowClosing(WindowEvent we){System.exit(0);}
}  


public void paint(Graphics g){

g.fillRect(100,100,50,50);

}


void op(){
int m,n;
double maxv,px,cx;
maxv=0;
pxs=0;
cxs=0;
for (m=10;m<100;m++){
for (n=1;n<100;n++){
px=m;
cx=10*n;
if (rev(th,px,cx,cost)>maxv)pxs=px;
if (rev(th,px,cx,cost)>maxv)cxs=cx;
if (rev(th,px,cx,cost)>maxv)maxv=rev(th,px,cx,cost);
}
}

}
最終更新:2011年03月06日 18:17