Jump to content

Question KATTIS Bijele.php


Recommended Posts

Hi guys, I'm having trouble solving this issue in .php, before I did it in .java but in php I don't know which way to go. Could anyone decide to compare it with the others?

image.png.73da8c7944f8585918c7e485dd894655.png

Link to post
Share on other sites

I did it in .java but I don't know how to switch to .php

 

import java.util.Scanner;
public class bijele {
    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        int[] neededPieces = {1,1,2,2,2,8};
        String[] currentPieces = in.nextLine().split(" ");

        for (int i = 0; i < 6; i++) {
            neededPieces[i] -= Integer.parseInt(currentPieces[i]);
            System.out.print("" + neededPieces[i] + " ");
        }
    }
}

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.