Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, sum = 0, znach;
  6.  
  7. cin >> a;
  8.  
  9. while (sum <= a) {
  10. for (int i = 1;; i++) {
  11. sum += 1 / i;
  12. znach = i;
  13. }
  14. }
  15.  
  16. cout << "From " << znach " to infinity";
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement