int main int argc char argv int double çíà åíèå âûðàæåíèÿ printf Pleas

 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");//ââåäåì öåëûå çíà÷åíèÿ p,q
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;
}