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] + " ");
}
}
}
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] + " ");
}
}
}
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?
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.