an ancient greek legend, the uninvited wedding goddess of discord and strife eris threw a wedding table a golden apple, on which was written a single word - "the most beautiful". were on olympus hera, athena and aphrodite arguing who should own this apple. each of them was rightfully deserves to own an apple, and even zeus refused to be their judge. he took the apple, gave it to hermes and told to withdraw goddesses in the neighborhood of troy, mount olympus, where they had to decide the dispute son of king priam of troy, paris. hera promised paris power over the whole of asia, athena - the glory and victory, and aphrodite promised him in marriage elenu.uslyhav wonderful promise of aphrodite, paris gave the apple of paris ey.afrodita helped kidnap helen, wife of spartan king menelaus, which later was the cause of the trojan war .
Поделитесь своими знаниями, ответьте на вопрос:
Знайдіть суму натурального ряду чисел від 1 до N.
Объяснение:
// Example program
#include <iostream>
#include <string>
int main()
{
int k[30];
for(int i = 0; i < 30; i ++) //заполняем случайными числами
k[i] = rand();
int min_sum = 999999999;
int num1, num2;
for(int i = 0; i < (30 - 1); i ++) //цикл поиска, i меняется от начала
//до предпоследнего элемента, чтобы не выйти
//за пределы при обращении к i + 1 элементу
{
int sum = k[i] + k[i+1];//очередная сумма
if(sum < min_sum) //сравниваем ее с текущим минимумом
{//если она меньше, то
min_sum = sum;//обновляем текущую сумму
num1 = i; num2 = i + 1;//обновляем номер
}
}
//на выходе из цикла в min_sum и num1 и num2 имеем самые минимальные номера
std::cout << "min_sum = " << min_sum << " nomer1 = " << num1 <<" nomer2 = " << num2;
}