-
Notifications
You must be signed in to change notification settings - Fork 5
/
P04_PhotoGallery.cs
47 lines (42 loc) · 1.57 KB
/
P04_PhotoGallery.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
namespace P04_PhotoGallery
{
class P04_PhotoGallery
{
static void Main(string[] args)
{
string imageName = $"Name: DSC_{int.Parse(Console.ReadLine()):D4}.jpg";
string dateTaken = $"Date Taken: {int.Parse(Console.ReadLine()):D2}/{int.Parse(Console.ReadLine()):D2}/{int.Parse(Console.ReadLine())} " +
$"{int.Parse(Console.ReadLine()):D2}:{int.Parse(Console.ReadLine()):D2}";
double bytes = int.Parse(Console.ReadLine());
int resolutionWidth = int.Parse(Console.ReadLine());
int resolutionHeight = int.Parse(Console.ReadLine());
Console.WriteLine(imageName);
Console.WriteLine(dateTaken);
string sizeName = "B";
if (bytes > 1000)
{
bytes /= 1000;
sizeName = "KB";
}
if (bytes > 1000)
{
bytes /= 1000;
sizeName = "MB";
}
Console.WriteLine($"Size: {bytes}{sizeName}");
if (resolutionHeight == resolutionWidth)
{
Console.WriteLine($"Resolution: {resolutionWidth}x{resolutionWidth} (square)");
}
else if (resolutionHeight > resolutionWidth)
{
Console.WriteLine($"Resolution: {resolutionWidth}x{resolutionHeight} (portrait)");
}
else
{
Console.WriteLine($"Resolution: {resolutionWidth}x{resolutionHeight} (landscape)");
}
}
}
}