bayuaji48

Chall IndoXploit Looping [C++]

Feb 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <stdlib.h>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int i,j,n,k,awal,nilai,nilai2;
  8.  
  9.     //system("clear");
  10.     system("figlet IndoXploit");
  11.     cout << "first: ";
  12.     cin >> awal;
  13.     cout << "rows: ";
  14.     cin >> nilai;
  15.     n = nilai + awal;
  16.     cout << "cols: ";
  17.     cin >> nilai2;
  18.     k = nilai2 - 1;
  19.     cout << "\n";
  20.     for(i = awal; i < n; ++i) {
  21.         cout << i - (awal - 1) << " -> " << i << "   ";
  22.         for(j = 1; j <= k; ++j) {
  23.             cout << i + j << "   ";
  24.         }
  25.         cout << endl;
  26.     }
  27. }
Add Comment
Please, Sign In to add comment