#include<stdio.h>
#include<math.h>
int main(int argc, char **argv){
// read in the command-line argument
double x,c;
double epsilon = 1e-15; // relative error tolerance
double t ; // estimate of the square root of c
//scanf("%lf",&t);
t=**argv-'0';
printf("%lf ",t);
c=t;
// repeatedly apply Newton update step until desired precision is achieved
while (fabs(t - c/t) > epsilon*t) {
t = (c/t + t) / 2.0;
}
// print out the estimate of the square root of c
printf("%lf",t);
return 0;
}
在这个程序中,我想使用命令行参数运行。我怎样才能做到这一点?