environment: codeblock
compilation environment: mingw32-gcc.exe-pedantic-Wextra-Wall-std=c99-c path
Code:
-sharpinclude <stdio.h>
int main(){
FILE *fin, *fout;
fin = fopen("data.in","rb");
fout = fopen("data.out","wb");
int m, n;
int line = 1;
while(fscanf(fin, "%lld%lld", &n, &m) == 2){
if(m == 0 && n == 0) break;
double sum = 0;
for(int i=n;i<=m;iPP){
//double j = i; //
sum += 1 / ((double)i * (double)i);
}
fprintf(fout, "Case %d: %.5f\n", line, sum);
linePP;
}
fclose(fin);
fclose(fout);
return 0;
}
question:
when the question line is double j = I
uncommented, data.out
will have output, but when the question line is commented, data.out
will not have output, why?
isn"t this business pointless?
input data is:
2 4
65536 655360
0 0