2012-10-28, 08:36 PM
SaptaZapta Wrote:-snip-
Rearranged it + fixed typos.
Code:
int n;
int dupecount = 0;
int count = 0; //prevNum is not defined in the 1st number, so I put this in.
int prevNum;
while (cin >> n) {
if (cin >> n && count != 0) {
if (prevNum == n) {
++dupecount;
}
}
int prevNum = n;
++count;
}
cout << dupecount;The inputs I got wrong and the inputs that I got right switched.

