Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Car Sensors
//Title of this code //'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_45 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int rMot = 0; int lMot = 0; int lSen = 0; int cSen = 0; int rSen = 0; String Sensors = "0 0 0"; Scanner scan = new Scanner(System.in); System.out.println("Enter the sensors that are on, without commas or spaces"); Sensors = scan.next(); System.out.println(Sensors); lSen = Integer.parseInt(Sensors.substring(0,1)); cSen = Integer.parseInt(Sensors.substring(1,2)); rSen = Integer.parseInt(Sensors.substring(2,3)); if (lSen==1 && cSen == 0 && rSen == 0) { System.out.println("Vroom vroom to the right mother fucker"); } } }
run
|
edit
|
history
|
help
0
Rakibul Haque
Find Case Combinations of a String
2b
Draw rectangle using for loop
Problem_fib
codesingnal Code
Problem: fb_series
add static
Problem 3: New Products
PE #5