Sort by

recency

|

3992 Discussions

|

  • + 0 comments

    As someone just now coming in for Java after learning some C# this stuff is wack. Tip: do some looking into how various scanner methods work on value types. Take special note of where it stops.

  • + 0 comments

    in python

    a=int(input()) b=float(input()) c=str(input()) sum1=a+i sum2=d+b sum3=s+c print(sum1) print(sum2) print(sum3)

  • + 0 comments

    import java.util.Scanner;

    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);
    
        // Declare variables
        int i2;
        double d2;
        String s2;
    
        // Read inputs
        i2 = scan.nextInt();
        d2 = scan.nextDouble();
        scan.nextLine();      // consume leftover newline
        s2 = scan.nextLine();
    
        // Print results
        System.out.println(i + i2);
        System.out.printf("%.1f\n", d + d2);
        System.out.println(s + s2);
    
        scan.close();
    }
    

    }

  • + 0 comments

    agreed on confunsing wording

    python3

    if __name__ == '__main__':
        i = int(4)
        d = float(4.0)
        s = str('HackerRank')
        
        a = int(input().strip())
        b = float(input().strip())
        c = str(input().strip())
        
        print(i+a)
        print(b+d)
        print(s, c)
    
  • + 0 comments

    I don't know if it's just me but the wording was super confusing.