Advertisement
xathrya

Pola 2

Nov 21st, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <cstdio>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int N, i, j;
  6.    
  7.     printf("Nilai N : ");
  8.     scanf("%d", &N);
  9.    
  10.     for (i=0; i<N; i++) {
  11.         for (j=0; j<=i; j++){
  12.             if (j==0 || j==i) {
  13.                 printf("#");
  14.             } else if (j%3==0) {
  15.                 printf("%d", j%10);
  16.             } else {
  17.                 printf(" ");
  18.             }
  19.         }
  20.         printf("\n");
  21.     }
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement