printf("n=%d,pi=%f\n ",n,pi); //Only add 1 semicolons.
pi = sqrt(a); Just move it to the front of the printed statement and don't put it in the loop body.
Input: 100000
De: n = 100000,pi = 3. 14 1363。