CCC '14 J1 - Triangle Times

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 0.25s
Memory limit: 256M

Problem type
Canadian Computing Competition: 2014 Stage 1, Junior #1

You have trouble remembering which type of triangle is which. You write a program to help. Your program reads in three angles (in degrees).

  • If all three angles are 60, output Equilateral.
  • If the three angles add up to 180 and exactly two of the angles are the same, output Isosceles.
  • If the three angles add up to 180 and no two angles are the same, output Scalene.
  • If the three angles do not add up to 180, output Error.

Input Specification

The input consists of three integers, each on a separate line. Each integer will be greater than 0 and less than 180.

Output Specification

Exactly one of Equilateral, Isosceles, Scalene or Error will be printed on one line.

Sample Input 1

60
70
50

Output for Sample Input 1

Scalene

Sample Input 2

60
75
55

Output for Sample Input 2

Error

Comments


  • 0
    ShibaInu140  commented on Jan. 25, 2026, 5:18 p.m.

    i don't think ur supposed to post the answer like that

    what if someone wanted a hint and so scrolled down to the end to find that

    not trying to be mean

    i'm just unsure

    >


  • -3
    23EPeattie  commented on Jan. 19, 2026, 3:49 p.m.

    Answer

    angle1 = int(input())

    angle2 = int(input())

    angle3 = int(input())

    if angle1 <= 0 or angle2 <= 0 or angle3 <= 0:

    print("Error")

    elif angle1 + angle2 + angle3 != 180:

    print("Error")

    else:

    if angle1 == angle2 == angle3:
    
        print("Equilateral")
    
    elif angle1 == angle2 or angle2 == angle3 or angle1 == angle3:
    
        print("Isosceles")
    
    else:
    
        print("Scalene")

    • 0
      do_ur_homwork  commented on Feb. 1, 2026, 11:16 p.m.

      Please don't put answers in the comment section!


  • -1
    rocket  commented on Jan. 5, 2026, 9:17 a.m.

    i spelled isosceles wrong 💀


    • 0
      EchoPlays  commented on Feb. 1, 2026, 10:10 p.m.

      same bro 😭