package deracinema;
import java.io.*;
class pro{
int s1,s2;
double h;
int cs[][]=new int[6][6];
int ys1[][]=new int[6][6];
int ys2[][]=new int[6][6];
double ch;
int th1[]=new int[6];
int th2[]=new int[6];
int c[][]=new int[6][6];
int y1[][]=new int[6][6];
int y2[][]=new int[6][6];
int upper[][]=new int[6][6];
int bs[]=new int[6];
double[][][] delta=new double[6][6][11];
public static void main(String[] args) {
pro test=new pro();
}
pro(){
h=0.001;
for(s1=1;s1<6;s1++){
th1[s1]=200*s1;
}
for(s2=1;s2<6;s2++){
th2[s2]=100*s2;
}
nearl sub=new nearl();
sub.nth1=th1;
sub.nth2=th2;
sub.h=h;
sub.makedata();
c=sub.nc;
y1=sub.ny1;
y2=sub.ny2;
int tr;
catchdata sub8=new catchdata();
sub8.makedata();
c=sub8.c;
y1=sub8.y1;
y2=sub8.y2;
for(tr=1;tr<10;tr++){
upper sub3=new upper();
sub3.th1=th1;
sub3.th2=th2;
sub3.h=h;
sub3.c=c;
sub3.y1=y1;
sub3.y2=y2;
sub3.makedata();
upper=sub3.upper;
budget sub2=new budget();
sub2.th1=th1;
sub2.th2=th2;
sub2.h=h;
sub2.c=c;
sub2.y1=y1;
sub2.y2=y2;
sub2.upper=upper;
sub2.makedata();
bs=sub2.op;
delta sub4=new delta();
sub4.th1=th1;
sub4.th2=th2;
sub4.h=h;
sub4.c=c;
sub4.y1=y1;
sub4.y2=y2;
sub4.upper=upper;
sub4.bs=bs;
sub4.makedata();
delta=sub4.delta;
maxvalue sub5=new maxvalue();
sub5.th1=th1;
sub5.th2=th2;
sub5.h=h;
sub5.c=c;
sub5.y1=y1;
sub5.y2=y2;
sub5.upper=upper;
sub5.delta=delta;
sub5.bs=bs;
sub5.makedata();
cs=sub5.cs;
ys1=sub5.ys1;
ys2=sub5.ys2;
int ep;
ep=0;
for(s1=1;s1<6;s1++){
for(s2=1;s2<6;s2++){
ep=ep+(y1[s1][s2]-ys1[s1][s2])*(y1[s1][s2]-ys1[s1][s2]);
ep=ep+(y2[s1][s2]-ys2[s1][s2])*(y2[s1][s2]-ys2[s1][s2]);
ep=ep+(c[s1][s2]-cs[s1][s2])*(c[s1][s2]-cs[s1][s2]);
}
}
System.out.println(ep);
check sub7=new check();
sub7.th1=th1;
sub7.th2=th2;
sub7.h=h;
sub7.c=cs;
sub7.y1=ys1;
sub7.y2=ys2;
ch=sub7.makedata();
System.out.println(ch);
c=cs;
y1=ys1;
y2=ys2;
}
writefile("data.txt");
}
void writefile(String file){
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
for(s1=1;s1<6;s1++){
for(s2=1;s2<6;s2++){
pw.print("<husband>");
pw.print(s1);
pw.print("</husband>");
pw.print("<wife>");
pw.print(s2);
pw.print("</wife>");
pw.print("<c>");
pw.print(c[s1][s2]);
pw.print("</c>");
pw.print("<y1>");
pw.print(y1[s1][s2]);
pw.print("</y1>");
pw.print("<y2>");
pw.print(y2[s1][s2]);
pw.println("</y2>");
}
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
}
最終更新:2013年08月16日 23:27