Created
January 11, 2013 20:15
-
-
Save anonymous/4513619 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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