Advertisement
Guest User

Untitled

a guest
May 27th, 2017
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 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.PhotoGallery
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var photoNumber = int.Parse(Console.ReadLine());
  14.             var day = int.Parse(Console.ReadLine());
  15.             var month = int.Parse(Console.ReadLine());
  16.             var year = int.Parse(Console.ReadLine());
  17.             var hours = int.Parse(Console.ReadLine());
  18.             var minutes = int.Parse(Console.ReadLine());
  19.             var size = double.Parse(Console.ReadLine());
  20.             var width = int.Parse(Console.ReadLine());
  21.             var height = int.Parse(Console.ReadLine());
  22.  
  23.             Console.WriteLine($"Name: DSC_{photoNumber:d4}.jpg");
  24.             Console.WriteLine($"Date Taken: {day:d2}/{month:d2}/{year:d4} {hours:d2}:{minutes:d2}");
  25.  
  26.             var sizeAb = "";
  27.            
  28.             if (size>=1000000)
  29.             {
  30.               size =  size / 1000000.00;
  31.                  sizeAb = "MB";
  32.  
  33.                 Console.WriteLine($"Size: {size:f1}{sizeAb}");
  34.             }
  35.             else if (size>= 1000)
  36.             {
  37.                 size = size / 1000.00;
  38.                 sizeAb = "KB";
  39.                 Console.WriteLine($"Size: {size}{sizeAb}");
  40.             }
  41.  
  42.             else
  43.             {
  44.                 sizeAb = "B";
  45.                 Console.WriteLine($"Size: {size}{sizeAb}");
  46.             }
  47.  
  48.             var resolution = "";
  49.  
  50.            if (width > height)
  51.             {
  52.                 resolution = "landscape";
  53.             }
  54.  
  55.            else if (width < height)
  56.             {
  57.                 resolution = "portrait";
  58.             }
  59.            else
  60.             {
  61.                 resolution = "square";
  62.             }
  63.  
  64.             Console.WriteLine($"Resolution: {width}x{height} ({resolution})");
  65.  
  66.  
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement