## Recommended Posts

//FileName:整數平方的倒數和

#include<stdio.h>

#include<stdlib.h>

int main(void) {

int i;

int(i=0; i<=10000; i++) ;

float a ;

float (a=1/i*i) ;

float b ;

float (b=0,b=a+b) ;

system("PAUSE") ;

return 0 ;

}

Edited by j100002ben

##### Share on other sites

`//FileName:整數平方的倒數和#include<stdio.h>#include<stdlib.h>int main(void) {int i;int(i=0; i<=10000; i++) ;float a ;float (a=1/i*i) ;float b ;float (b=0,b=a+b) ;system("PAUSE") ;return 0 ;}`

float (a=1/i*i) ;

float (b=0,b=a+b) ;

int(i=0; i<=10000; i++) ;

Edited by 伊達政宗

##### Share on other sites

new code

`#include<stdio.h>#include<stdlib.h>int main(void) {        int i;        float sum = 0.0;        for(i = 1; i <= 10000; i++){                sum += 1 / (i * i);        }        printf("%f", sum);        return 0;}  `

##### Share on other sites

Python很神祕阿

http://pastebin.com/bCNm620D

Edited by 真神秘

##### Share on other sites

//FileName:整數平方的倒數和

#include<stdio.h>

#include<stdlib.h>

int main(int argc, char *argv[]){

int i;

for(i=0; i<=10000; i++){

float a ;

a = a + 1/i*i ;

}

printf("a");

system("PAUSE") ;

return 0 ;

}

##### Share on other sites
//FileName:整數平方的倒數和

#include<stdio.h>

#include<stdlib.h>

int main(int argc, char *argv[]){

int i;

for(i=0; i<=10000; i++){

float a ;

a = a + 1/i*i ;

}

printf("a");

system("PAUSE") ;

return 0 ;

}

a = a + 1 / i * i;

Python對他們來說不熟了~xd

##### Share on other sites
//FileName:整數平方的倒數和

`#include<stdio.h>#include<stdlib.h> int main(int argc, char *argv[]){    int i;    for(i=0; i<=10000; i++){             float a ;             a = a + 1/i*i ;             }    printf("a");    system("PAUSE") ;    return 0 ;}`

http://blog.dcview.com/article.php?a=VmhQNVY%2BCzo%3D

Kahan summation algorithm

PS：其他版眾先解決樓主問題啦，即使我很喜歡Python也覺得Python很美還是覺得有學C的價值啊:)

Edited by j100002ben

##### Share on other sites

http://blog.dcview.com/article.php?a=VmhQNVY%2BCzo%3D

PS：其他版眾先解決樓主問題啦，即使我很喜歡Python也覺得Python很美還是覺得有學C的價值啊:)

##### Share on other sites

http://blog.dcview.com/article.php?a=VmhQNVY%2BCzo%3D

Kahan summation algorithm

PS：其他版眾先解決樓主問題啦，即使我很喜歡Python也覺得Python很美還是覺得有學C的價值啊:)

C因為偏低階所以超棒\(H)/

Python神好用啦

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account. 