Advertisement
Pandarec13

111

Oct 12th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. float a = 2;
  7. float b = 4;
  8. float c=0;
  9. c = c + (1 / a) - (1 / b);
  10. while (b != 24) {
  11.  
  12. b += 4;
  13. a += 4;
  14. c = c + (1 / a);
  15. c = c - (1 % b);
  16.  
  17. }
  18. cout << round(c*100)/100 << endl;
  19. system("pause");
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement