BubaLazi

PhotoGallery

Jun 7th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.82 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 ComplexConditions
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var num = 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 hour = int.Parse(Console.ReadLine());
  18.             var minute = 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.             var bytes = "";
  24.             var orientation = "";
  25.  
  26.             if(width > height)
  27.             {
  28.                 orientation = "landscape";
  29.             }
  30.             else if(width<height)
  31.             {
  32.                 orientation = "portrait";
  33.             }
  34.             else if(width == height)
  35.             {
  36.                 orientation = "square";
  37.             }
  38.  
  39.             if(size <= 1024)
  40.             {
  41.                 bytes = "B";
  42.             }
  43.             else if(size > 1024 && size <= 1048576)
  44.             {
  45.                 size = size / 1000;
  46.                 bytes = "KB";
  47.              }
  48.             else if( size > 1048576 )
  49.             {
  50.                 size = size / 1000000;
  51.                 bytes = "MB";
  52.             }
  53.  
  54.             Console.WriteLine("Name: DSC_{0:D4}.jpg ", num);
  55.             Console.WriteLine("Date Taken: {0:D2}/{1:D2}/{2:D2} {3:D2}:{4:D2}", day,month, year, hour, minute);
  56.             Console.WriteLine("Size: {0}{1}", size, bytes );
  57.             Console.WriteLine("Resolution: {0}x{1} ({2})", width, height, orientation);
  58.  
  59.  
  60.  
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment