Advertisement
Guest User

Untitled

a guest
May 1st, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include "std_lib_facilities.h"
  2.  
  3.  
  4. int square(int main_input)
  5. {
  6.     int var_copy = 0;
  7.     int static_copy = main_input;
  8.     int i = 0;
  9.  
  10.     while (i < static_copy)
  11.     {
  12.         if (i > 0)
  13.         {
  14.             var_copy = static_copy;
  15.         }
  16.         main_input = main_input + var_copy;
  17.         i++;
  18.     }
  19.  
  20.     return main_input;
  21. }
  22.  
  23. int main()
  24.  
  25. {
  26.     for (int i = 0; i < 100; i++)
  27.     {
  28.         cout << i << " " << square(i) << "\n";
  29.     }
  30.     cout << "\n";
  31.     keep_window_open();
  32.  
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement