Advertisement
Guest User

povecaj

a guest
Jan 26th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. void unos(int niz[6]){
  5.     int a = 0;
  6.     cout << "Unesite 7 el. niza: " << endl;
  7.     for (int i = 0; i <= 6; i++)
  8.     cin >> a;
  9. }
  10.  
  11.  
  12. int djeljiv(int niz[])
  13. {
  14.     int brojac = 0;
  15.     for (int i = 0; i < 6; i++)
  16.     {
  17.         if (niz[i] % 5 == 0)
  18.         {
  19.             brojac++;
  20.         }
  21.     }
  22.  
  23.  
  24.     return brojac;
  25. }
  26.  
  27. void povecaj(int niz[])
  28. {
  29.     for (int i = 0; i < 6; i++)
  30.     {
  31.         if (niz[i] % 2 == 0)
  32.         {
  33.             cout << niz[i] * 2;
  34.         }
  35.  
  36.     }
  37.  
  38. }
  39.  
  40. int main()
  41. {
  42.     int niz[6];
  43.     for (int i = 0; i < 6; i++)
  44.     {
  45.         cin >> niz[i];
  46.     }
  47.     cout << "Broj djeljenih sa 5 je " << djeljiv(niz) << endl;;
  48.     povecaj(niz);
  49.  
  50.     system("pause>null");
  51.     return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement