BAR_PC - HWzone Forums
Skip to content
  • Create an account

BAR_PC

registered user
  • Number of messages

    32
  • joining

  • Recently visited

Rating

0 neutral

About BAR_PC

  • rank
    Zone NewUser
  • Birthday 14/07/1996

Recent Visitors

Visitors to your profile are disabled, and you can not see who recently visited your profile.

  1. I managed thank you and sorry
  2. Yes thank you very much indeed! Appreciate
  3. Yes two functions that get an array and return a cell number (each checks on each side) and another function that checks if the conditions are met then it returns the cell number if it does not return -1. I want to save the cell to check the function and return the cell number if necessary
  4. Error copying I fixed int i to divide_left. Where would you place the loops? That's how it goes through all the cells, no? Basically I forgot to update (sorry in advance) that the instruction of the exercise is to do 3 functions one that will check from the right one to the left and the third one checks if both are met and returns the cell tax or -1. So I do not see any other way except that you will check on me from every side and if both are met then ... is there another option according to the instructions? Thanks
  5. Is this what needs to be done? Because here too it is neural that there is a problem ... // ------ include section ------- #include #include // ------ std section ------- using std :: cin; using std :: cout; using std :: endl; // ------ const section const int N = 6; // The size you want to set // --- prtotypes section ---- void read_data (int arr []); int divide_left (int arr [], int cell); int divide_right (int arr [], int cell); int happend (int arr [], int cell); ///// ----- Main ------- int main () {int arr [N]; read_data (arr); int cell; int found = happend (arr, cell); cout << f
  6. I change the cell with j each time up by 1 or lower by one as needed (right left) to check if the cell divides in all cells ... or in my head think differently as if I was trying to shorten it by a loop that if the cell divides on the left then with j it Will check the cell after it and so on or are thoughts apart and code apart Did you understand my intention? ... Thank you
  7. You mean, like, saltines and their ilk, eh? I'll try it thanks but why does he not answer the question? Fact that in some examples it works.
  8. Hi I would still love to help with this exercise I do not understand why he does not print -1 ... thanks
  9. What a part ... so how do I print it? I'm already confused ... because I changed the condition in main to be inverse meaning found not equal to -1 so print -1 otherwise print the cell (message above) and I entered the example 180 120 60 30 20 15 it printed me 3 but on the other hand I entered say 6 5 4 3 2 1 the output was 1 and I entered 9 0 0 0 0 0 so the output was empty thanks
  10. Hi guys I drove you really crazy but feel lonely on the subject and I have no one to turn to ... if I change the terms here: if (found! = -1) cout << cell1; else cout << "-1"; So: if (found! = -1) cout << "-1"; else cout << cell1; So in the example 180 120 60 30 20 15 output 3 that it is ok but no then it does not output -1 can someone please explain to me why? Thank you very much and sorry again
  11. Sorry I'm driving you crazy but is this a better code or have you already done what you said? In fact it still prints -1. Here I used them Do you understand what I did? As if I kept the cell each time to check the following and if not then move to the next cell it still prints me -1 ... // ------ include section ------- #include #include // ------ std section ------- using std :: cin; using std :: cout; using std :: endl; // ------ const section const int N = 6; // The size you want to set // --- prtotypes section ---- void read_data (int arr []); int divide_left (int arr [], int & cell); int divide_right (int arr [], int & cell); int
  12. The whole test of each cell will be in one function?
  13. Don't have a simple need for them?
  14. In one function or per function cell? Check there is no shortcut? hook
  15. Does that mean make a pur loop for each simple cell? Or something else? As for the other, I did not understand .. Thank you
×
  • Create new ...

At the top of the news:

In June everything will work out? The MWC 2021 exhibition begins with a Corona-adapted version

Instead of a grandiose mobile celebration in Barcelona - we get a relatively small event in Shanghai this week, and plans for a European comeback this coming June The MWC (Mobile World Congress) was the first notable technological event to suffer last year's coronation, with naive restrictions in the first stage, Complete cancellation of the physical event afterwards - and at the same time promises that next year everything will return to normal, when it is likely that at that point in time no one guessed or predicted that even in 2021 ...

new on the site