using System; public class Program{ public static void Main() { string[] tokens = Console.ReadLine().Split(); for (int i = 0; i < 3; i++) { double a = double.Parse(tokens[i]); if (a >= 0) Console.Write(a*a + " "); else Console.Write(a*a*a*a + " "); } }}
Answers & Comments
using System;
public class Program{ public static void Main() { string[] tokens = Console.ReadLine().Split(); for (int i = 0; i < 3; i++) { double a = double.Parse(tokens[i]); if (a >= 0) Console.Write(a*a + " "); else Console.Write(a*a*a*a + " "); } }}