Advertisement
TwITe

Untitled

Aug 14th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. void floors() {
  2.     int n, k = 1, count = 0;
  3.     cin >> n;
  4.     for (int i = 0; i < n; i++) {
  5.         if (k + count == i) {
  6.             count++;
  7.             k = i;
  8.         }
  9.     }
  10.     cout << count;
  11. }
  12.  
  13. int main() {
  14.     floors();
  15.  
  16.     system("PAUSE");
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement