小编And*_*usK的帖子

指向矩形内部

我想问这个功能是否正确.它应检查点是否在矩形内部,如果是,则将其打印出来.

#include <stdio.h>
#include <stdlib.h>

typedef struct {
  int x;
  int y;
}point;

typedef struct {
  point A;
  point B;
}rectangle;

int main() {
rectangle s;
point T;
printf("Enter rectangle A point x coordinate :\n" );
scanf("%d", &s.A.x);
printf("Enter rectangle A point y coordinate :\n" );
scanf("%d", &s.A.y);
printf("Enter rectangle B point x coordinate :\n" );
scanf("%d", &s.B.x);
printf("Enter rectangle B point y coordinate :\n" );
scanf("%d", &s.B.y);    
printf("\nrectangle - A(%d, %d), B(%d, %d) \n", s.A.x, s.A.y, s.B.x, s.B.y ); …
Run Code Online (Sandbox Code Playgroud)

c point rectangles

3
推荐指数
1
解决办法
562
查看次数

标签 统计

c ×1

point ×1

rectangles ×1