FindDups

FindDups - } for(int i = 0; i < place-1; i++){...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class FindDups{ public static void main(String[ ] args){ int[ ] nums = new int[10]; int place=0; int number = IO.readInt( ); while (number > 0){ nums[place] = number; place++; number = IO.readInt( );
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } for(int i = 0; i < place-1; i++){ for(int j = i + 1; j < place; j++){ if (nums[i] == nums[j]){ IO.outputStringAnswer("duplicate " + nums[i] + " at " + i + " and " + j); } } } } }...
View Full Document

This note was uploaded on 07/12/2009 for the course CS 111 taught by Professor Hari during the Fall '08 term at Rutgers.

Ask a homework question - tutors are online