fork(1) download
  1. import 'dart:io';
  2.  
  3. void main() {
  4. int n = 5;
  5. if(n%2 == 0){
  6. return;
  7. }
  8.  
  9. int row = 3*n;
  10. int col = 2 *n;
  11. int spaceBefore = 1;
  12. int spaceAfter = 2*n-1;
  13. int rowmid = ((row-1)/2).round();
  14.  
  15. for(int i = 1; i<=row; i++){
  16. if(i<n){
  17. print("*"*spaceBefore + " "*spaceAfter);
  18. }else if(i==n){
  19. print("*"*n+ " "*n);
  20. }
  21.  
  22.  
  23. }
  24.  
  25.  
  26.  
  27. }
Success #stdin #stdout 1.21s 132136KB
stdin
Standard input is empty
stdout
*         
*         
*         
*         
*****