Skip to content

Conversation

@enzobarba
Copy link

No description provided.

@Helias
Copy link
Member

Helias commented Nov 1, 2025

il workflow codestyle fallisce, vedi perchè

Comment on lines 15 to 18
for(int i = 0; i < DIM; i++){
if(x == N[i])
return true;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for(int i = 0; i < DIM; i++){
if(x == N[i])
return true;
}
for (int i = 0; i < DIM; i++) {
if (x == N[i])
return true;
}

Nonscriveremaituttoattaccato, usa degli spazi quando scrivi codice, aumenterai la leggibilità

Comment on lines 31 to 34
if(found)
cout << "The number " << x << " is present in the array" << endl;
else
cout << "The number " << x << " is not present in the array" << endl;
Copy link
Collaborator

@Picred Picred Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potresti usare un operatore ternario quando il risultato di una stampa dipende da una variabile che modifica solamente una parola (not) o in quantità minima.

Suggested change
if(found)
cout << "The number " << x << " is present in the array" << endl;
else
cout << "The number " << x << " is not present in the array" << endl;
cout << "The number " << x << " is" << (found ? "" : " not") << " present in the array" << endl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants