herrDeng網內搜尋

自訂搜尋

Ads

2011年10月21日 星期五

實作多項式x*A(x)

給定多項式A(x)
輸出多項式x*A(x)

5 則留言:

b9933016 提到...

class B1
{
public static void main(String[] args)
{
int j=3;
float[] poly=new float[3];
poly[0]=1.4f;
poly[1]=2.3f;
poly[2]=3.7f;
for(int i=poly.length-1;i>=0;i--)

{
System.out.print(poly[i]+"X^"+(i+1)+"+");
if(i==0)
{System.out.print(poly[i]+"X^"+(i+1));}

}
System.out.println();
}
}

b9911126 提到...

class ex
{
public static void main(String[] args)
{
int j=3;
float[] poly=new float[3];
poly[0]=1.4f;
poly[1]=2.3f;
poly[2]=3.7f;
for(int i=poly.length-1;i>=0;i--)
{
System.out.print(poly[i]+"X^"+(i+1)+"+");
if(i==0)
{System.out.print(poly[i]+"X^"+(i+1));}
}
System.out.println();
}
}

B9933006 提到...

public class A2
{
public static void main(String[] args)
{
int j=3;

float[] poly=new float[3];
poly[0]=2.4f;
poly[1]=3.6f;
poly[2]=4.5f;

for(int i=poly.length-1; i>=0; i--)
{
System.out.print(poly[i]+"X^"+(i+1)+" + ");
if(i==0)
{
System.out.print(poly[i]+"X^"+(i+1));
}
}
System.out.println();
}
}

B9933015 提到...

class A1
{
public static void main(String[] args)
{
int j=3;
float[] poly=new float[3];
poly[0]=1.4f;
poly[1]=2.3f;
poly[2]=3.7f;
for(int i=poly.length-1;i>=0;i--)

{
System.out.print(poly[i]+"X^"+(i+1)+"+");
if(i==0)
{System.out.print(poly[i]+"X^"+(i+1));}

}
System.out.println();
}
}

b9933014 提到...

public class 12{
public static void main(String[] args)
{
int j=3;

float[] poly=new float[3];
poly[0]=2.4f;
poly[1]=3.6f;
poly[2]=4.5f;

for(int i=poly.length-1; i>=0; i--)
{
System.out.print(poly[i]+"X^"+(i+1)+" + ");
if(i==0)
{
System.out.print(poly[i]+"X^"+(i+1));
}
}
System.out.println();
}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章