Online Code Compiler

FREEMIUM
By Glavier | Updated un mese fa | Tools
Popularity

9.5 / 10

Latency

2,056ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Pass More than one input ,I'm passing hard coded values but it didn't taken!!

Rapid account: Simplesimon 1803
simplesimon1803
10 mesi fa

import java.util.Scanner;

public class GetTwoInputs {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int firstNumber = scanner.nextInt();
scanner.close();
System.out.println( firstNumber);
}
}

angular.element(document).ready(function () {
$(“button”).click(function () {
let code = editor.getValue();
// var userinput = document.getElementById(‘userinput’).value;
// var userinput1 = document.getElementById(‘userinput1’).value;
debugger
const dataa = new URLSearchParams();
dataa.append(‘name’, ‘John’);
dataa.append(‘email’, ‘john@example.com’);
console.log(dataa)
let data = {
language: lang_id,
version: “latest”,
code: code,
input: [“1”,“2”],
};
console.log(dataa)
$http({
method: ‘POST’,
// url: ‘https://online-code-compiler.p.rapidapi.com/v1/’,
url :‘https://online-code-compiler.p.rapidapi.com/v1/’,
data: data,
headers: {
“content-type”: “application/json”,
“Content-Type”: “application/json”,
‘X-RapidAPI-Key’: ‘9ac2e88fbemsh78d070b24758726p149e3ajsn2bedd4f1fded’,
‘X-RapidAPI-Host’: ‘online-code-compiler.p.rapidapi.com
}
}).then(function (response) {
// debugger;
// console.log("response ",response);
$scope.checkStatus(response.data.output);
});
});
});

Rapid account: Vigneshwarans
vigneshwarans Commented 9 mesi fa

I think you want to pass using next line like “1\n2”

Join in the discussion - add comment below:

Login / Signup to post new comments