Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void calculation_array(int a[], const int size)
  5. {
  6.     int Numero;
  7.  
  8.     for (int j = 0; j < size; j++)
  9.     {
  10.         Numero = a[j];
  11.  
  12.         for (int i = Numero - 1; i > 1; i--)
  13.             if (Numero % i == 0)
  14.                 cout << "число не простое";
  15.     }
  16.  
  17.     cout << "Numeri interi: " << Numero << "\n";
  18. }
  19.  
  20.  
  21. int enter_array(int a[], const int size)
  22. {
  23.     for (int i = 0; i < size; i++)
  24.     {
  25.         cout << "Enter a[" << i << "] ";
  26.  
  27.         return a[i];
  28.     }
  29. }
  30. void imput_array(int a[], const int size)
  31. {
  32.     for (int i = 0; i < size; i++)
  33.         cin >> a[i];
  34. }
  35.  
  36. int main()
  37. {
  38.     const int size = 10;
  39.     int a[size];
  40.     enter_array(a, size);
  41.     imput_array(a, size);
  42.     calculation_array(a, size);
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement