Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. int n;
  9. cout << "Podaj ilosc liczb:" << endl;
  10. cin >> n;
  11. int tab[n];
  12. int sum = 0;
  13. for(int i = 0; i < n; i++){
  14. cout << "Podaj wartosc " << i+1 << "-ej liczby:" << endl;
  15. cin >> tab[i];
  16. }
  17. for(int i = 0; i < n; i++)
  18.  
  19. {
  20. if(tab[i]%7 == 0){
  21. sum ++;
  22. }
  23. }
  24. cout<<"--------------------------------"<<endl;
  25. cout << endl << "Ilosc liczb podzielnych przez 7 wynosi:" << sum << endl;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement