简体   繁体   English

我不知道为什么我的方法不起作用(如果声明)

[英]I don't know why my method won't work (if statements)

This program classifies quadrilaterals. 该程序将四边形分类。 I'm not sure why my method just won't work, the coordinates I used were (08,4),nd (5,5). 我不确定为什么我的方法不起作用,我使用的坐标是(08,4),nd(5,5)。 All my other methods work so I don't think its because of my formula. 我所有其他方法都有效,所以我不认为这是因为我的公式。

if((ab == bc && cd == da) || (bc == cd && da == ab)) if((ab == bc && cd == da)||(bc == cd && da == ab))

in your case any rectangle is kite ( 1 + 2 == 1 + 2) 在您的情况下,任何矩形都是风筝(1 + 2 == 1 + 2)

if((ab + bc) == (cd + da) || (bc + cd) == (da + ab)){}

如果不放在方括号中,则编译器将查看元素的优先级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM