Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int isInside(int bod_x, int bod y)
- {
- /* kontrola zda bod uvnitr */
- return (0);
- }
- int isPolygon(int x1,int y1,int x4,int y4)
- {
- /* jednotlive strany se nesmeji protinat , vraci 1 v pripade ze neni n-uhelnik */
- return (0);
- }
- int main (void)
- {
- int bod_x, bod_y, sour[8], i=6;
- printf("Zadejte souradnice bodu:\n");
- if(scanf("%d %d",&bod_x,&bod_y)!=2)
- {
- printf("Nespravny vstup.\n");
- return (1); /* nespravny vstup - spatne zadane souradnice bodu */
- }
- printf("Zadejte body n-uhelniku:\n");
- if(scanf("%d %d",&sour[0],&sour[1]))
- {
- printf("Nespravny vstup.\n");
- return (1); /* nespravny vstup - spatne zadane souradnice bodu nebo nedostatek souradnic */
- }
- if(scanf("%d %d",&sour[2],&sour[3]))
- {
- printf("Nespravny vstup.\n");
- return (1); /* nespravny vstup - spatne zadane souradnice bodu nebo nedostatek souradnic */
- }
- if(scanf("%d %d",&sour[4],&sour[5]))
- {
- printf("Nespravny vstup.\n");
- return (1); /* nespravny vstup - spatne zadane souradnice bodu nebo nedostatek souradnic */
- }
- while(1)
- {
- if(scanf("%d %d",&sour[i++],&sour[i++]))
- {
- printf("Nespravny vstup.\n");
- return (1);
- }
- i%=8;
- if(isPolygon(sour[0],sour[1],sour[6],sour[7]))
- {
- printf("Zadane body netvori n-uhelnik\n");
- return (1);
- }
- if(feof(stdin)) /* konec vstupu */
- isInside(bod_x,bod_y);
- }
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement