int main int argc char argv int double printf Please input scanf scanf

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
int main(int argc, char *argv[])
{
int p,q;
double f;
printf("Please input p,q:\n");
scanf("%d",&p);
scanf("%d",&q);
f = q>=100 ?((p+q)/(2.*q)) : (q>0 && p<20) ? (p-2*q) : (p-3*q);
printf("f=%lf\n",f);
system("PAUSE");
return 0;
}