Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Numerics;
- namespace SoftuniExercisesWithVariables
- {
- class Program
- {
- static void Main(string[] args)
- {
- string numbers = Console.ReadLine();
- string[] nums = numbers.Split(" ");
- float[] floatNums = new float[nums.Length];
- float[] rounded = new float[nums.Length];
- for (int i = 0; i < nums.Length; i++)
- {
- floatNums[i] = float.Parse(nums[i]);
- }
- for(int k = 0;k< nums.Length; k++)
- {
- rounded[k] = (float)Math.Ceiling(floatNums[k]);
- }
- for(int line = 0; line < nums.Length; line++)
- {
- Console.WriteLine($"{floatNums[line]} => {rounded[line]:f0}");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment