Advertisement
vallec

kris

Jan 25th, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int n = 200;
  9.  
  10. printf("Vavedi golemina na n: ");
  11. scanf("%d", &n);
  12. while(n > 100){
  13. printf("Vavedenoto chislo n trqbva da e po - malko ili ravno na 100\n");
  14. printf("Vavedi golemina na n: ");
  15. scanf("%d", &n);
  16. }
  17.  
  18. int arr[n];
  19. for(int i = 0; i < n; i++){
  20. printf("Vavedi chislo: ");
  21. scanf("%d", &arr[i]);
  22. }
  23.  
  24. int pr = 1;
  25. for(int i = 0; i < n; i++){
  26. if(arr[i] > 0 && arr[i] % 5 == 0){
  27. pr = pr * arr[i];
  28. }
  29. }
  30.  
  31. printf("Proizvedenieto e ravno na %d", pr);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement