Skip to content

Dev lc610 #1078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{
"files": [
"solution/0500-0599/0578.Get Highest Answer Rate Question/Solution.sql",
"solution/0600-0699/0610.Triangle Judgement/Solution.sql",
"solution/0600-0699/0618.Students Report By Geography/Solution.sql",
"solution/0600-0699/0626.Exchange Seats/Solution.sql",
"solution/1000-1099/1098.Unpopular Books/Solution.sql",
Expand Down
10 changes: 9 additions & 1 deletion solution/0600-0699/0610.Triangle Judgement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,20 @@ Triangle 表:

<!-- 这里可写通用的实现逻辑 -->

**方法一:if 语句 + 三角形判断条件**

三条边能否构成三角形的条件是:任意两边之和大于第三边。因此,我们可以使用 `if` 语句来判断是否满足这个条件,如果满足则返回 `Yes`,否则返回 `No`。

<!-- tabs:start -->

### **SQL**

```sql

# Write your MySQL query statement below
SELECT
*,
if(x + y > z AND x + z > y AND y + z > x, 'Yes', 'No') AS triangle
FROM Triangle;
```

<!-- tabs:end -->
6 changes: 5 additions & 1 deletion solution/0600-0699/0610.Triangle Judgement/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ Triangle table:
### **SQL**

```sql

# Write your MySQL query statement below
SELECT
*,
if(x + y > z AND x + z > y AND y + z > x, 'Yes', 'No') AS triangle
FROM Triangle;
```

<!-- tabs:end -->
5 changes: 5 additions & 0 deletions solution/0600-0699/0610.Triangle Judgement/Solution.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Write your MySQL query statement below
SELECT
*,
if(x + y > z AND x + z > y AND y + z > x, 'Yes', 'No') AS triangle
FROM Triangle;