Advertisement
Guest User

04 Photo Gallery

a guest
May 27th, 2017
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _04_Photo_Gallery
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int number = int.Parse(Console.ReadLine());
  14.             int day = int.Parse(Console.ReadLine());
  15.             int month = int.Parse(Console.ReadLine());
  16.             int year = int.Parse(Console.ReadLine());
  17.             int hour = int.Parse(Console.ReadLine());
  18.             int minutes = int.Parse(Console.ReadLine());
  19.             double size = double.Parse(Console.ReadLine());
  20.             int width = int.Parse(Console.ReadLine());
  21.             int height = int.Parse(Console.ReadLine());
  22.  
  23.             Console.WriteLine("Name: DSC_{0:d4}.jpg", number);
  24.             Console.WriteLine("Date Taken: {0:d2}/{1:d2}/{2} {3:d2}:{4:d2}",
  25.                 day, month, year, hour, minutes);
  26.             if (size < 1000)
  27.             {
  28.             Console.WriteLine("Size: {0}B", size);
  29.             }
  30.             else if (size < 1000000)
  31.             {
  32.                 size /= 1000;
  33.                 Console.WriteLine("Size: {0}KB", size);
  34.             }
  35.             else
  36.             {
  37.                 size /= 1000000;
  38.                 Console.WriteLine("Size: {0}MB", size);
  39.             }
  40.  
  41.             if (width > height)
  42.             {
  43.                 Console.WriteLine($"Resolution: {width}x{height} (landscape)");
  44.             }
  45.             else if (height > width)
  46.             {
  47.                 Console.WriteLine($"Resolution: {width}x{height} (portrait)");
  48.             }
  49.             else if (height == width)
  50.             {
  51.                 Console.WriteLine($"Resolution: {width}x{height} (square)");
  52.             }
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement