Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- private static void Main()
- {
- int num = int.Parse(Console.ReadLine());
- while (num % 2 == 0)
- {
- num = int.Parse(Console.ReadLine());
- Console.WriteLine("Please write an odd number.");
- }
- Console.WriteLine($"The number is: {Math.Abs(num)}"); // Math.Abs превръща ми отрицателно число в положително
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment