Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Photo_Gallery
- {
- class Photo_Gallery
- {
- static void Main(string[] args)
- {
- ushort photosNumber = ushort.Parse(Console.ReadLine());
- sbyte day = sbyte.Parse(Console.ReadLine());
- sbyte month = sbyte.Parse(Console.ReadLine());
- ushort year = ushort.Parse(Console.ReadLine());
- sbyte hours = sbyte.Parse(Console.ReadLine());
- sbyte minutes = sbyte.Parse(Console.ReadLine());
- uint photosSizeInByte = uint.Parse(Console.ReadLine());
- ushort widthPhotoInPixeles = ushort.Parse(Console.ReadLine());
- ushort heightPhotoInPixeles = ushort.Parse(Console.ReadLine());
- string size = String.Empty;
- string orientation = String.Empty;
- double photosSize = 0;
- if (photosSizeInByte < 1E+3)
- {
- photosSize = photosSizeInByte;
- size = "B";
- }
- else if (photosSizeInByte >= 1E+3 && photosSizeInByte < 1E+6)
- {
- photosSize = photosSizeInByte / 1E+3;
- size = "KB";
- }
- else if (photosSizeInByte >= 1E+6 && photosSizeInByte < 1E+9)
- {
- photosSize = photosSizeInByte / 1E+6;
- size = "MB";
- }
- orientation = widthPhotoInPixeles > heightPhotoInPixeles ? "landscape" :
- widthPhotoInPixeles == heightPhotoInPixeles ? "square" : "portrait";
- Console.WriteLine($"Name: DSC_{photosNumber:D4}.jpg");
- Console.WriteLine($"Date Taken: {day:D2}/{ month:D2}/{year:D4} {hours:D2}:{minutes:D2}");
- Console.WriteLine($"Size: {photosSize}{size}");
- Console.WriteLine($"Resolution: {widthPhotoInPixeles}x{heightPhotoInPixeles} ({orientation})");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement