📄 example6_6.java
字号:
import java.applet.*;
import java.awt.*;
public class Example6_6 extends Applet
{
public static double f(double x)
{double y;
y=Math.pow(x,10);
return y; }
public static double GaussChebyshev(int n)
{double x,s;int i;
s=0;x=Math.PI/2/n;
for(i=1;i<=n;i++)
{s+=Math.PI/n*f(Math.cos(x));x+=Math.PI/n;}
return s;
}
public void paint(Graphics g)
{double y;
int n;
for(n=1;n<=6;n++)
{y=GaussChebyshev(n);
g.drawString("I"+n+"="+y,10,20*n);
}
}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -