Telaryon

Négyszög #, *, @ -ból

Mar 24th, 2017
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4.     int N;
  5.     int column;
  6.     int row;
  7.    
  8.     printf("Negyszög #-bol es *-ból @ atloval\n");
  9.     printf("Adja meg, a negyszog meretet: \n");
  10.     scanf("%d", &N);
  11.     for(row=0; row<=N; row++) {
  12.         for (column=0; column<=N; column++) {
  13.                 if(column<row){
  14.                     printf(" # ");
  15.                 } else {
  16.                     if(column==row){
  17.                         printf(" @ ");
  18.                     }else{
  19.                         printf(" * ");
  20.                     }
  21.                 }
  22.         }
  23.         printf("\n");
  24.     }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment