Sort by

recency

|

3971 Discussions

|

  • + 0 comments

    import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;

    public class Solution {

    public static void main(String[] args) {
        int i = 4;
        double d = 4.0;
        String s = "HackerRank ";
    
        Scanner scan = new Scanner(System.in);
    

    // BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); /* Declare second integer, double, and String variables. / int var1=i; double var2=d; String var3=s; / Read and save an integer, double, and String to your variables.*/ var1+=scan.nextInt(); var2+=scan.nextDouble(); scan.nextLine(); var3+=scan.nextLine(); // Note: If you have trouble reading the entire String, please go back and review the Tutorial closely.

        /* Print the sum of both integer variables on a new line. */
    

    System.out.println(var1); System.out.println(var2); System.out.println(var3);

        /* Print the sum of the double variables on a new line. */
    
        /* Concatenate and print the String variables on a new line; 
            the 's' variable above should be printed first. */
    
        scan.close();
    

    } }

  • + 0 comments
     int i2 = 0;
            double d2 = 0.0;
            String s2 = "";
            
            i2 = Integer.parseInt(scan.nextLine().replace("\\s", ""));
            d2 = Double.parseDouble(scan.nextLine().replace("\\s", ""));
            s2 = scan.nextLine();
            
            System.out.println(i + i2);
            System.out.println(d + d2);
            System.out.println(s + s2);
    
  • + 1 comment

    cin.ignore(): to ignore the \n left in buffer fixed<

  • [deleted]
    + 3 comments

    Hello Everyone,

    When I run the code, it says test case 0 passed. Wheere they have asked for second test case?

    • + 0 comments

      please go to this if anyone who are unable to solve this problem

  • + 0 comments

    Do you want to hire a hacker to solve your problems in various conditions? If you require the services of a genuine hacker and do not have any idea about how to hire a professional hacker online, you are at the right place.

    CONTACT US: https://brunoequickhack.com/