Home > Back-end >  C a classical topic
C a classical topic

Time:10-01

Duplicate Elimination with array) Use a one - dimensional array to solve the following
Problem. Read in 20 Numbers, each of which is between 10 and 100, inclusive. As each number is
Read, validate it and store it in the array only if it isn 't a duplicate of a number already read. After
Reading all the values to display only the unique values that the user rose. Dojo.provide for "worst
Case "in which all 20 Numbers are marketers. Use the smallest possible array to solve this problem.

Void Dea: : Input ()
{
Cout<& lt;" Enter any number between 10 and 100, 4 times \ n ";
Do {

Cin> The input;//user input
//check input the range
If (input> 9 & amp; & Input & lt; 101)
{
//a loop for the check, I don 't know how to do in here
//I want to use loop check without include any library

A [count]=input;


}

The else//not right to store wrong value
A [count]=! The input;


+ + count;


} while (count<4);






}



}


Void Dea: : display ()
{

For (int count=0; Count<4. Count++)
Cout}


Under the big brand check repeat that part not to enter the ARRAY and then in the DISPLAY only not repeat number


  • Related