Skip to content

Conversation

@SL-TX
Copy link
Owner

@SL-TX SL-TX commented Aug 20, 2022

1.5 Массивы

public static void main(String[] args) {

// Задание 1
int[] i = new int[3];
Copy link

@iStemmer iStemmer Aug 20, 2022

Choose a reason for hiding this comment

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

i - очень плохое имя для массива, i,j,k,m,n,l - используются для циклов - легко можно запутаться
Надо поправить

Copy link
Owner Author

Choose a reason for hiding this comment

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

Переименновать все переменные в intArray, doubleArray, charArray или для ДЗ так оставить?

// Задание 4
for (int j = 0; j < i.length; j++) {
if (i[j]%2==1)
i[j]+=1;

Choose a reason for hiding this comment

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

не забываем про форматирование Ctrl+Alt+L


// Задание 2
for (int j = 0; j < i.length; j++) {
if (j == i.length - 1)

Choose a reason for hiding this comment

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

используй {} в циклах, даже если это не обязательно, гугл рекомендует придерживаться

Copy link
Owner Author

Choose a reason for hiding this comment

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

В циклах или в If -ах?

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