WHAT IS THIS????
#include <iostream> #include <fstream> #include <cmath> using namespace std; ifstream in("max.in"); int n, nr, cnr, i, j, u, uc, max1 = 0, max2, ss[3500];// sir schimbat int main() { in >> n; for (i = 0; i < n; i++) { in >> nr; cnr = nr; max2 = nr; u = -1; // 43, 32, 9, 43, 21, 76, 211, 97, 321. while (cnr > 0) { cnr /= 10; u++; } cout << nr << '\n'; for (j = 0; j < u; j++) { uc = nr % 10; nr = nr / 10; nr = nr + pow (10, u) * (uc == 0 ? 1 : uc); if (max2 < nr) max2 = nr; cout << nr << '\n'; } if (max1 < max2) max1 = max2; ss[i] = max2; cout << "max1:"<< max1; } } // Could you please test this out on your machine and put these numbers (9 34 23 9 43 21 67 121 79 213) in "max.in" ? // You'll also have to create the "max.in" file oviously // This program is supposed to try all different combinations of the digits of the numbers within a set taken one by one while keeping record of the biggest number that was met which is max1 // I'm having very weird bugs, help me! // max1 is supposed to be 321