.
(x,y) .
y = ax+b. , , . , , . ,
. :
.
.
.
: (0,-1) (2,0). a b.
|
:
, (x,y) . . .
.
, . , , (x>=-2) (x<=0) (y>=-2) (y<=2). , , (x>=0) (x<=2) (y>=-1) (y<=1).
1. // - // // 2. main 3. 4. x,y . float 5. 6. 7. scanf( , ). s. ( int) 8. ( ) , . 9. - . | #include <stdio.h> #include <conio.h> #include <stdlib.h> void main() { clrscr(); float x,y; printf ( \n); printf( : ); int s; s = scanf(%f%f,&x,&y); if (s!=2){ printf( , .); getch(); exit(0); } else { if (x>=-2 &&x<=0&&y>=-2&& y<=2 || x>=0 && x<=2 && y>=-1 && y<=1) printf( (%9.2f, %9.2f) ,x,y); else printf( (%9.2f, %9.2f) ,x,y); } getch(); } |
|
|