Water and Ice#8611

Water and Ice (Editorial)

To solve this problem, use a conditional statement.

Algorithm implementation

Read the input temperature value .

scanf("%d", &t);

Based on the value of , print the corresponding result.

if (t > 0)
  printf("Water\n");
else
  printf("Ice\n");

Java implementation

import java.util.*;

public class Main
{
  public static void main(String[] args) 
  {
    Scanner con = new Scanner(System.in);
    int t = con.nextInt();
    if (t > 0)
      System.out.println("Water");
    else
      System.out.println("Ice");    	
    con.close();
  }
}

Python implementation

Read the input temperature value .

t = int(input())

Based on the value of , print the corresponding result.

if t > 0:
  print("Water")
else:
  print("Ice")