I am tring to get rid of dupes and his code is taking the first input and repeating it. I don't know why.
this is what i have so far can anyone help
this is what i have so far can anyone help
Code:
#include <iostream>
using namespace std;
int main() {
int scores[20];
int value;
int dupes;
int count = 0;
cout << "Enter list: ";
for(int i = 0; i < 20; i++) {
cin >> value;
if(value == 0)
break;
if (scores[i] == value)
{
dupes = 1;
}
if (dupes != 1)
{
scores[count] = value;
count++;
}
cout << scores[0]<< "," ;
}
return 0;
}
Comment