herrDeng網內搜尋

自訂搜尋

Ads

2013年4月9日 星期二

for-loop練習

請計算
sum=1/(1*1)+1/(2*2)+1/(3*3)+......1/(n*n) ,n=10000

69 則留言:

B9933133張靖 提到...

public class Test_01 {

public static void main(String[] args) {

float sun = 0, i = 1, n = 10000;
for (; i <= n; i++) {
sun = sun + 1 / (i * i);
}
System.out.println(sun);
System.out.print(Math.PI * Math.PI / 6);

}

}

b9833154徐瑋侖 提到...


public class test {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int i ;
int n = 10000 ;
double sum = 0 ;
for (i=1; i<= n; i++)
{
sum= (sum + 1/(double)(i*i)) ;

}
System.out.println(sum);
System.out.println(Math.PI*Math.PI/6);
}

}

B9933122苑珮婕 提到...

public class ex02 {

public static void main(String[] args) {

double sun=0,i=1,n=10000;
for(;i<=n;i++){
sun=sun+1/(i*i);
}
System.out.println(sun);
System.out.print(Math.PI*Math.PI/6);
}

}

B9933133張靖 提到...

public class Test_01 {

public static void main(String[] args) {

double sun = 0, i = 1, n = 10000;
for (; i <= n; i++) {
sun = sun + 1 / (i * i);
}
System.out.println(sun);
System.out.print(Math.PI * Math.PI / 6);

}

}

B10133009王韋翔 提到...

public class test1 {
public static void main(String[] args)
{
double x,sum=0;
for(int i=1;i<=10000;i++)
{
sum = sum + (double)1/(i*i);
}
System.out.print("sum="+sum);
}
}

B10133032黃徐琨 提到...

public class aa {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133005李沛澤 提到...


public class aa {
public static void main(String[] args){
System.out.println("Hello");
double sum=0;
for (int j=1;j<=10000;j++){
sum=sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B9833102曾冠誌 提到...

public class aaaa {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double sum=0;
int n=10000;
for(int i=1;i<=n;i++){
sum = sum + 1/(double)(i*i);

}
System.out.println(sum);

}


}

B10133013林子恩 提到...


public class PSO2
{
public static void main(String[] args)
{
double sum = 0;
for (int i = 1; i <10000; i++)
{
sum = sum + (double)1 /(i*i);
}
System.out.println("sum"+sum);
}
}

B10133025王柏文 提到...


public class PSO2
{
public static void main(String[] args)
{
double sum = 0;
for (int i = 1; i <10000; i++)
{
sum = sum + (double)1 /(i*i);
}
System.out.println("sum"+sum);
}
}

B10133050張珈祥 提到...

public class hello {
public static void main(String[] args)
{
double x,sum=0;
for(int i=1;i<=10000;i++)
{
sum = sum + (double)1/(i*i);
}
System.out.print("sum="+sum);
}
}

B10133037施竣哲 提到...

public class 123 {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
⋯⋯ for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133029 彭義竣 提到...

double result = 0;
for (double index = 1; index <= 10000; index += 1) {
result = 1 / (index * index) + result;
}
System.out.println(result);

B10133019 王騰侑 提到...

public class REX {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
⋯⋯ for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133010蔡以翎 提到...

public class hello {


public static void main(String[] args) {

double sum=0;
for (int i=1;i<=10000;i++ ){
sum+=(double)1/(i*i) ;

}
System.out.println(sum);
}

}

B10133004徐芷瑩 提到...


public class hello123 {


public static void main(String[] args) {

double sum=0;
for(int i=1;i<=10000;i++){
sum+=(double)1/(i*i);

}
System.out.println(sum);

}

}

B9933179陳俊翰 提到...

public class for2 {

static public void main(String[] args){
double sum=0;

for(int i=1;i<=10000;i++)
sum+=(double)1/i/i;

System.out.println(sum);
}
}

B10133033 呂之筠 提到...

public class win {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
⋯⋯ for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133011黃怡蓁 提到...

public class hello {
public static void main(String[] args){
double x,sum=0;
for(int i=1;i<=10000;i++){
sum=sum+(double)1/(i*i);
}
System.out.print("sum="+sum);

}
}

B10133031 邱敏惠 提到...

public class hello {
public static void main(String[] args)
{
double x,sum=0;
for(int i=1;i<=10000;i++)
{
sum = sum + (double)1/(i*i);
}
System.out.print("sum="+sum);
}
}

B10133051張丞緯 提到...

public class hello {
public static void main(String[] args)
{
double sum = 0;
{
for (int i=1 ; i<=10000 ; i++)
{
sum = sum +(double) 1 / (i*i);
}
System.out.println("sum="+sum);
}
}
}

B10133048饒家華 提到...

public class hello123 {

public static void main(String[] args)
{
double sum=0;
for(int i=1; i<=10000; i++)
{

sum=sum+1./i/i;
}
System.out.println(sum);

}
}

B10133021吳屹軒 提到...

public class ya {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133042沈俞宜 提到...

public class hello {
public static void main(String[] args)
{
double x,sum=0;
for(int i=1;i<=10000;i++)
{
sum = sum + (double)1/(i*i);
}
System.out.print("sum="+sum);
}
}

B10133016王致翔 提到...

public class karama {
public static void main(String[] args){
double sum=0;
for(int i=1 ; i<=10000; i++)
{
sum=sum+1./i/i;
}
System.out.print(sum);
}
}

B10133017張永憲 提到...

public class aaa {


public static void main(String[] args) {
double s=0;
for (int i =1; i< 10000; i++) {
s +=(double) 1.0/i/i;

}
System.out.println(s);
}
}

b10133022蔡承霖 提到...

public class aaaaaaaaa{

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133027黃為邦 提到...

public class aa
{
public static void main(String[] args)
{
double x,sum=0;
for(int i=1;i<=10000;i++)
{
sum = sum + (double)1/(i*i);
}
System.out.print("sum="+sum);
}

B10133006游善棠 提到...

public class java {

public static void main(String[] args) {
double sum=0;
for(double a=1 ; a<=10000 ; a++){
sum=sum+1 /a/a;
}

System.out.println(sum);



}

}

B10133008許耀文 提到...

public class hello {
public static void main(String[] args)
{
double sum = 0;
{
for (int i=1 ; i<=10000 ; i++)
{
sum = sum +(double) 1 / (i*i);
}
System.out.println("sum="+sum);
}
}
}

B10133020李涵清 提到...

public class hellow {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
⋯⋯ for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133023徐顥 提到...

public class sam
{
public static void main(String[] args{
double sum=0;
for(int i=1 ; i<=10000; i++)
{
sum=sum+1./i/i;
}
System.out.print(sum);
}
}

B10133044吳盛盟 提到...

class fir{
public static void main(String[] args){
double sum=0;
for(double i=1;i<=10000;i++){
sum+=1/(i*i);
}
System.out.print(sum);
}
}

B10133012 呂富凱 提到...

public class FK {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
⋯⋯ for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

b10133040溫翊惠 提到...

public class qqq{

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133049連于瑄 提到...

public class cc{

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133038池侑承 提到...

class apple{
public static void main(String[] args){
double sum=0;
for(double a=1;a<=10000;a++){
sum+=1/(a*a);
}
System.out.println(sum);
}
}

B10133046邱誌寬 提到...

class sor{
public static void main(String[] args){
double sum=0;
for(double i=1;i<=10000;i++){
sum+=1/(i*i);
}
System.out.print(sum);
}
}

B10133034石嘉萱 提到...

public class cc{

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133036孫翊玲 提到...

public class cc{

public static void main(String[] args) {
double sum=0;
for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133014 吳欣怡 提到...

public class hello {
public static void main(String[] args) {
double x,sum=0;
for(int i=1;i<=1000;i++)
{
sum =sum +(double)1/(i*i);
}
System.out.print("sum="+sum);
}
}

b10133045林玹安 提到...


public class apple {
public static void main(String[]args) {
double b=0;
for(double a= 1 ; a <= 10000; a++){
b+=1/(a*a);
}
System.out.println(b);
}

}


B10133030林潔如 提到...

public class hello12345 {
public static void main(String[] args)
{
double x,sum = 0;
for (int i = 1; i<=10000; i++ )
{
sum = sum + (double)1/(i*i);
}
System.out.println("sum"+sum);
}
}

B10133015楊超文 提到...

public class aa
{
public static void main(String[] args)
{
double x,sum=0;
for(int i=1;i<=10000;i++)
{
sum = sum + (double)1/(i*i);
}
System.out.print("sum="+sum);
}

B10133002謝佩紋 提到...

public class hello
{ public static void main(String[] args) {
double x,sum = 0;
for (int i = 1; i<=10000; i++ ) {
sum = sum + (double)1/(i*i); } System.out.println("sum"+sum); } }

B9933180陳威羽 提到...

public class form111 {

static public void main (String[] args) {
double sum = 0 ;
for(int i=1; i<= 10000;i++) {
sum += (double) 1 /i /i ;

}
System.out.print(sum);
}
}

B10133043陳宗霖 提到...


public class apppp {


public static void main(String[] args) {

double sum=0;
for(int a=1 ; a<=10000; a++){
sum=sum+(double)1/(a*a);
}
System.out.println(sum);
}

}

B10133018翁湘姿 提到...

public class hello {
public static void main(String[] args)
{
double x,sum = 0;
for (int i = 1; i<=10000; i++ )
{
sum = sum + (double)1/(i*i);
}
System.out.println("sum"+sum);
}
}

B1133009王韋翔 提到...

public class test1 {
public static void main(String [] args)
{
int n=10000;
double sum =0;
int i=1;
while(i<=n)
{
sum += (double)1/i/i;
i++;
}
System.out.print("sum="+sum);
}

}

B9933179陳俊翰 提到...

public class while1 {

static public void main(String[] args){

double sum=0;
int i=1,n=10000;

while(i<=n){
sum+=(double)1/i/i;
i++;
}

System.out.println(sum);
System.out.println(Math.PI*Math.PI/6);
}
}

B10133051張丞緯 提到...

public class hello {
public static void main(String[] args) {
{

double sum = 0;
int n=10000;
int i=1;
while (i<=n)
{
sum+=(double)1/(i*i);
i++;
}
System.out.println("sum="+sum);
}
}

}

B10133013林子恩 提到...

public class pso2 {
public static void main(String[] args)
{
int n=10000;
double sum =0;
int i=1;
while(i<=n)
{
sum += (double)1/i/i;
i++;
}
System.out.print("sum"+sum);
}
}

B10133048饒家華 提到...

public class hello123 {
public static void main(String[] args) {
double sum=0;
double n=10000;
double i=1;
while(i<=n){
sum+=1./i/i;
i++;
}
System.out.println(sum);

}

}

B10133016王致翔 提到...

public class LinDa
{
public static void main(String[] args)
{
double sum = 0;
double n = 10000;
double i = 1;
while(i <= n)
{
sum+=1./i/i;
i++;
}
System.out.print(sum);
}

}

b10133023徐顥 提到...

public class sam
{
public static void main(String[] args)
{
double sum = 0;
double n = 10000;
double i = 1;
while(i <= n)
{
sum+=1./i/i;
i++;
}
System.out.print(sum);
}

}

b10133045林玹安 提到...

public class apple {

public static void main(String[]args) {
double b = 0;
double a = 1;
while (a < 10000){
b += 1/(a*a);
a++;
}
}
}

B10133038池侑承 提到...

public class apple {
public static void main(String[] args){
double sum=0;
double n=10000;
double i=1;
while(i<=n){
sum+=1/(i*i);
i++;
}
System.out.println(sum);
}
}

B10133053古聿穎 提到...


public class while1 {

public static void main(String[] args) {

double sum=0;
int i=1,n=10000;

while(i<=n){
sum+=(double)1/i/i;
i++;
}
sum+=(double)1/i/i;


System.out.println(sum);
System.out.println(Math.PI*Math.PI/6);

}

}

B10133053古聿穎 提到...


public class while1 {

public static void main(String[] args) {

double sum=0;
int i=1,n=10000;

while(i<=n){
sum+=(double)1/i/i;
i++;
}
sum+=(double)1/i/i;


System.out.println(sum);
System.out.println(Math.PI*Math.PI/6);

}

}

B10133053古聿穎 提到...


public class while1 {

public static void main(String[] args) {

double sum=0;
int i=1,n=10000;

while(i<=n){
sum+=(double)1/i/i;
i++;
}
sum+=(double)1/i/i;


System.out.println(sum);
System.out.println(Math.PI*Math.PI/6);

}

}

B9833091陳孟偉 提到...

public class NYPD {


public static void main(String[] args) {

double sum=0;
for(int i=1;i<=10000;i++){
sum+=(double)1/(i*i);

}
System.out.println(sum);

}

}


B10133053古聿穎 提到...

public class test1 {
public static void main(String[] args)
{
double x,sum=0;
for(int i=1;i<=10000;i++)
{
sum = sum + (double)1/(i*i);
}
System.out.print("sum="+sum);
}
}

B10133053古聿穎 提到...

public class test2 {
public static void main(String[] args)
{
double x,sum=0;
for(int i=1;i<=10000;i++)
{
sum = sum + (double)1/(i*i);
}
System.out.print("sum="+sum);
}
}

B10036036陸語萱 提到...

public class ex02 {

public static void main(String[] args) {

double sun=0,i=1,n=10000;
for(;i<=n;i++){
sun=sun+1/(i*i);
}
System.out.println(sun);
System.out.print(Math.PI*Math.PI/6);
}

}

B10133048饒家華 提到...

public class aa {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}


B10133047 鄭兆珊 提到...

public class sss {

public static void main(String[] args) {

double sun=0,i=1,n=10000;
for(;i<=n;i++){
sun=sun+1/(i*i);
}
System.out.println(sun);
System.out.print(Math.PI*Math.PI/6);
}

}

B10133049 連于瑄 提到...

public class hello {

public static void main(String[] args) {
System.out.println("Hello");
double sum=0;
⋯⋯ for (int j = 1; j < 10001; j++) {
sum =sum+(double) 1/(j*j);
}
System.out.println(sum);
}
}

B10133019 王騰侑 提到...

public class Test_01 {

public static void main(String[] args) {

float sun = 0, i = 1, n = 10000;
for (; i <= n; i++) {
sun = sun + 1 / (i * i);
}
System.out.println(sun);
System.out.print(Math.PI * Math.PI / 6);

}

}

B10133019 王騰侑 提到...

public class Test_01 {

public static void main(String[] args) {

float sun = 0, i = 1, n = 10000;
for (; i <= n; i++) {
sun = sun + 1 / (i * i);
}
System.out.println(sun);
System.out.print(Math.PI * Math.PI / 6);

}

}

Related Posts Plugin for WordPress, Blogger...

熱門文章