79605635

Date: 2025-05-04 12:54:01
Score: 4.5
Natty:
Report link

If the integer value of each cell in the array contains more than one Sign :

int A[6] = {77,89,84,69,88,84};
#include <iostream>



int main()
{
    
    int A[6] = {77,89,84,69,88,84};
    int lengthA = 6;
    int num = 0;
    
    for(int x = 0; x < lengthA; x++)
    {
        
        num = num*10 + A[x];
    
    }
    
    
    std::cout<<"Result: "<<num;//Result: 8681864

    return 0;
}

Execution result:

8681864

instead of:

778984698884

The same result will be the execution of all other examples from the answers provided here, because they work according to the same principle.

How to solve this problem?

Reasons:
  • Blacklisted phrase (1): How to solve
  • RegEx Blacklisted phrase (1.5): How to solve this problem?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: GeorgeCain