#include <iostream>
using namespace std;
int main()
{
int arr[6];
float sum = 0;
for (int i = 0; i < 6; i++) {
cout << "Введите " << i << " элемент: ";
cin >> arr[i];
if(arr[i] % 3 == 0){
sum = sum + (arr[i]/3);
}
else{
sum = sum + (arr[i]*arr[i]);
cout << "\nСумма = " << sum << endl;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main()
{
int arr[6];
float sum = 0;
for (int i = 0; i < 6; i++) {
cout << "Введите " << i << " элемент: ";
cin >> arr[i];
if(arr[i] % 3 == 0){
sum = sum + (arr[i]/3);
}
else{
sum = sum + (arr[i]*arr[i]);
}
}
cout << "\nСумма = " << sum << endl;
return 0;
}