Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void get_values(int *array, int number_of_elements)
- {
- int i;
- for (i = 0; i < number_of_elements; i++)
- {
- cout << "vvedite znachenie " << i << ": ";
- cin >> array[i];
- }
- }
- int main(void)
- {
- char a = 0;
- do
- {
- int numbers[3];
- get_values(numbers, 3);
- cout << "znachenie massiva: " << endl;
- for (int i = 0; i < 3; i++)
- cout << numbers[i] << endl;
- int average = 0;
- for(int i = 0;i < 3;i++)
- {
- average += numbers[i] ;
- }
- cout << average << endl;
- cout << "prodolzit? " << endl;
- cin >> a;
- } while (a == 'd');
- }
Advertisement
Add Comment
Please, Sign In to add comment