-
Notifications
You must be signed in to change notification settings - Fork 0
Peaks detect nishonov #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Tab'ы заменены на пробелы; Код разделен на 2 функции, чтобы оптимизировать поиск нужного трэка.
| @@ -0,0 +1,83 @@ | |||
| void piki (float* amplitudes, float* frequences, float* x, float* y, int* l) //x, y - ��� �������� �����; l - ����� ����� �������� ����� | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чудовищное название функции. Переименуйте.
Длинна строки 80 символов
Комментарии к функции на новой строке
отступ 4 пробела
| {int i, j, t, flag; | ||
| l=0; | ||
| for (i=0; i<=q; i++) //���� �� ��������� �������, ��� N - ������������ ���-�� �������� � �������� ��� | ||
| if (amplitudes[i]>501) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что такое 501? почему именно это число?
| @@ -0,0 +1,83 @@ | |||
| void piki (float* amplitudes, float* frequences, float* x, float* y, int* l) //x, y - ��� �������� �����; l - ����� ����� �������� ����� | |||
| {int i, j, t, flag; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
перенос строки после открывающей скобки
| @@ -0,0 +1,83 @@ | |||
| void piki (float* amplitudes, float* frequences, float* x, float* y, int* l) //x, y - ��� �������� �����; l - ����� ����� �������� ����� | |||
| {int i, j, t, flag; | |||
| l=0; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
пробелы вокруг знака присваивания
| void piki (float* amplitudes, float* frequences, float* x, float* y, int* l) //x, y - ��� �������� �����; l - ����� ����� �������� ����� | ||
| {int i, j, t, flag; | ||
| l=0; | ||
| for (i=0; i<=q; i++) //���� �� ��������� �������, ��� N - ������������ ���-�� �������� � �������� ��� |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
пробелы вокруг = и <=
| void piki (float* amplitudes, float* frequences, float* x, float* y, int* l) //x, y - ��� �������� �����; l - ����� ����� �������� ����� | ||
| {int i, j, t, flag; | ||
| l=0; | ||
| for (i=0; i<=q; i++) //���� �� ��������� �������, ��� N - ������������ ���-�� �������� � �������� ��� |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
преинкремент быстрее, так что используйте преинкремент
Пробелы вокруг =, <=
| {int i, j, t, flag; | ||
| l=0; | ||
| for (i=0; i<=q; i++) //���� �� ��������� �������, ��� N - ������������ ���-�� �������� � �������� ��� | ||
| if (amplitudes[i]>501) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробелы вокруг >
И далее вокруг всех операций, кроме пост и преинкремента
| if (amplitudes[i]>501) | ||
| { | ||
| t=501; | ||
| while ((amplitudes[i]>501)&&(i<=q)) //������������� ��� |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while ((amplitudes[i] > 501) && (i <= q))
| for (i=0; i<=q; i++) //���� �� ��������� �������, ��� N - ������������ ���-�� �������� � �������� ��� | ||
| if (amplitudes[i]>501) | ||
| { | ||
| t=501; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что такое 501? Почему 501, а не 1674 или 927592825?
Создайте константу и дайте ей внятное имя
| { //n - ���-�� ����� ����� � ����, l - ���-�� ����� �������� ����� | ||
| int i, flag; | ||
| float m, k; | ||
| if (l==0) print("������� �� ������"); //���� ����� ��� |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (statement1)
{
operator;
}
else if (statement2)
{
...
}
No description provided.