Jeremiah_

1144 - URI - Sequência Lógica (Logical Sequence) in C++

Apr 14th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a=1, n;
  8.     cin >> n;
  9.     for(int i=1; i<=n*2; i++){
  10.         if(i%2==0){
  11.             cout << a << " " << a*a+1 << " " << (a*(a*a))+1 << endl;
  12.             a++;
  13.         }else
  14.             cout << a << " " << a*a << " " << a*(a*a) << endl;
  15.     }
  16.     return 0;
  17. }
Add Comment
Please, Sign In to add comment