We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Alright, i havent been watching your tutorial before you said to watch it, thank you for reply tho, im not trying to do demagoguery, but it's working with the button run, so i assume it means that everything is correct and i'm getting values for my variables out of object System.in and it's printing out how expected, even tho it looks very ugly because of tons of variables and i could do it with the cycle, but anyways i will watch your tutorial for sure, thank you!
Here is a different variant of how i see it suppose to work, but it's still showing runtime error when i'm trying to submit:
/* Declare second integer, double, and String variables. */inti1;doubled1;Strings1;Strings2;Strings3;Strings4;Strings5;Strings6;Strings7;Strings8;Strings9;Strings10;/* Read and save an integer, double, and String to your variables.*/i1=scan.nextInt();d1=scan.nextDouble();s1=scan.next();s2=scan.next();s3=scan.next();s4=scan.next();s5=scan.next();s6=scan.next();s7=scan.next();s8=scan.next();s9=scan.next();s10=s1+" "+s2+" "+s3+" "+s4+" "+s5+" "+s6+" "+s7+" "+s8+" "+s9;/* Print the sum of both integer variables on a new line. */System.out.println(i+i1);/* Print the sum of the double variables on a new line. */System.out.println(d+d1);/* Concatenate and print the String variables on a new line; the 's' variable above should be printed first. */System.out.println(s+s10);
scan.close();}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 1: Data Types
You are viewing a single comment's thread. Return to all comments →
Alright, i havent been watching your tutorial before you said to watch it, thank you for reply tho, im not trying to do demagoguery, but it's working with the button run, so i assume it means that everything is correct and i'm getting values for my variables out of object System.in and it's printing out how expected, even tho it looks very ugly because of tons of variables and i could do it with the cycle, but anyways i will watch your tutorial for sure, thank you!
Here is a different variant of how i see it suppose to work, but it's still showing runtime error when i'm trying to submit: