Skip to content

Instantly share code, notes, and snippets.

Created January 11, 2013 20:15
Show Gist options
  • Save anonymous/4513619 to your computer and use it in GitHub Desktop.
Save anonymous/4513619 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int mass [15];
int sr=0, j=0;
for (int i=0;i<15;i++)
{
cout << "введите " << i <<" элемент массива: ";
cin >> mass [i];
for (int i=0;i<15;i++)
if (i % 3 != 0) {
sr += mass[i];
j++;
}
}
if (j != 0) {
sr /= j;
cout << "среднее арифметическое равно " << sr << endl;
} else {
cout << "Не найдено элементов, удовлетворяющих условию" << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment