#include <iostream>using namespace std; #define n 13 int main(){ setlocale(LC_ALL, "rus"); int *a = new int[n]; printf("\n >> Введите массив из %d элементов\n << ", n); for (int i = 0; i < n; i++) scanf("%d",&a[i]); int Sm = 0; int k = 0; for (int i = 0; i < n; i++) if ((a[i] % 4 == 1) || (a[i] % 4 == 3)) { Sm += a[i]; k++; } if (k) printf("\n >> Sr = %g", (float)Sm / k); else printf("\n >> k = 0"); delete[] a; system("pause>>void"); return 0;}
#define n 13
int main(){ setlocale(LC_ALL, "rus"); int *a = new int[n];
printf("\n >> Введите массив из %d элементов\n << ", n); for (int i = 0; i < n; i++) scanf("%d",&a[i]);
int Sm = 0; int k = 0; for (int i = 0; i < n; i++) if ((a[i] % 4 == 1) || (a[i] % 4 == 3)) { Sm += a[i]; k++; }
if (k) printf("\n >> Sr = %g", (float)Sm / k); else printf("\n >> k = 0");
delete[] a; system("pause>>void"); return 0;}