Advertisement
Brankicaj

suma do nekog broja

Oct 12th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int sum=0, broj;
  8. while (sum<=1000)
  9. {cin >>broj;
  10. if (broj%2==0 || broj%10==5) sum=sum+broj;
  11. }
  12. cout << sum-broj << endl;
  13.  
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement