User Profile

Collapse

Profile Sidebar

Collapse
Bekir
Bekir
Last Activity: Sep 27 '17, 03:17 PM
Joined: Sep 24 '17
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Bekir
    replied to Array input
    in Java
    Code:
    package dan1;
    
    import java.util.Scanner;
    
    public class Nizovi6 {
    	public static void main(String [] args){
    		Scanner scanner = new Scanner(System.in);
    		int n = scanner.nextInt();
    		int [] index = new int [n];
    		int [] score = new int [n];
    		for(int i = 0;i < n;i++){
    			index[i] = scanner.nextInt();
    			score[i] = scanner.nextInt();
    		}
    		for(int
    ...
    See more | Go to post
    Last edited by Frinavale; Sep 25 '17, 01:48 PM.

    Leave a comment:


  • Bekir
    started a topic Array input
    in Java

    Array input

    Hello,I have question about arrays.I know how to input array with for loop but i have to learn how to input array like this:
    n - number of elements
    we've got index and score of player and i have to sort it from the biggest.I did all good but i stuck on one thing.
    Ex: n=3
    index score
    1 20
    2 30
    3 10
    it has to output
    2 30
    1 20
    3 10
    but my program's output is:
    ...
    See more | Go to post
No activity results to display
Show More
Working...