Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ivan;
- import java.util.Scanner;
- public class _04_Photo_Gallery {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int photoUmber = Integer.parseInt(input.nextLine());
- int day = Integer.parseInt(input.nextLine());
- int month = Integer.parseInt(input.nextLine());
- int year = Integer.parseInt(input.nextLine());
- int hours = Integer.parseInt(input.nextLine());
- int minutes = Integer.parseInt(input.nextLine());
- int bytes = Integer.parseInt(input.nextLine());
- int width = Integer.parseInt(input.nextLine());
- int height = Integer.parseInt(input.nextLine());
- String printedbytes="";
- if (bytes < 1000)
- {
- printedbytes = bytes + "B";
- }
- else if (bytes < 1000000)
- {
- bytes /= 1000;
- printedbytes = bytes + "KB";
- }
- else
- {
- bytes /= 1000000;
- printedbytes= bytes + "MB";
- }
- String oriention = "square";
- if (width > height)
- {
- oriention = "landscape";
- }
- else if (width < height)
- {
- oriention = "portrait";
- }
- System.out.printf("Name: DSC_%04d.jpg\n",photoUmber);
- System.out.printf("Date Taken: %02d/%02d/%d %02d:%02d\n",day,month,year,hours,minutes);
- System.out.printf("Size: %s\n",printedbytes);
- System.out.printf("Resolution: %dx%d (%s)",width,height,oriention);
- //
- // Console.WriteLine("Date Taken: {0:d2}/{1}/{2} {3}:{4}", day, month.PadLeft(2, '0'), year, hours.PadLeft(2, '0'), minutes.PadLeft(2, '0'));
- //
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement