#Why does my message repeat when I don't want it to?

1 messages · Page 1 of 1 (latest)

sleek fiber
#

I'm trying to figure out how to make it so when I say that an integer is the lowest number it won't keep repeating that in the code.

worn crane
#

we're going to need more info. #📄・posting-guidelines

sleek fiber
#

Okay so basically what I'm trying to do is make it so when a set on integers are input I have to first, cout all of the integers except for the one that's the minimum, then once all those are output i also output the minimum, the issue i'm running into is that the minimum will either keep repeating in the middle of the output or at the wrong spot.

worn crane
sleek fiber
# worn crane can you provide us the code/what you've tried?

I'm sorry I finally figured out what the problem was but I do have another question, this time i'm trying to make a sequence where it reads each integer, if they equal 10 then you output "Fully Complient" and if they don't all equal 10 then you output "Non matching Values," Most of the tests are working except for one and i'm not quite sure why.

#
#include <iostream>
using namespace std;

int main() {
   int numVals;
   double fullyCompliant;
   int i;
cin >> numVals;
   for (i = 0; i <= numVals; ++i) {
     
      if (numVals == 10) {
         fullyCompliant = true;
      }
      else {
         fullyCompliant = false;
      }
       cin >> numVals;
   }

   if (fullyCompliant) {
      cout << "Fully compliant" << endl;
   }
   else {
      cout << "Non-matching value(s)" << endl;
   }

   return 0;
}
#
Special character legend
Input
7
10 10 9 10 10 10 10
Your output
Fully compliant
Expected output
Non-matching value(s)
echo wyvern
#

That...makes little sense

#

Why are you reusing a variable in such a way that it's going to behave unpredictably? Also, you are resetting your compliance inappropriately

half mirage