From 2d725cce52f7408c0f90cc03c40cb0a358ab017f Mon Sep 17 00:00:00 2001 From: Zahra Gharagozloo Mazlaghan Date: Wed, 22 Apr 2026 15:59:05 +0330 Subject: [PATCH] Main Exercise 1 completed. --- src/main/java/MainExercises.java | 29 +++++++++-------------------- src/test/java/MainTestTriangle.java | 2 +- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/main/java/MainExercises.java b/src/main/java/MainExercises.java index 21581ea..a8fd7fb 100644 --- a/src/main/java/MainExercises.java +++ b/src/main/java/MainExercises.java @@ -1,28 +1,17 @@ public class MainExercises { - /* - you should create a triangle with "*" and return a two-dimensional array of characters based on that - the triangle's area is empty, which means some characters should be " " - - example 1, input = 3: - * - ** - *** - - example 2, input = 5: - * - ** - * * - * * - ***** - - the output has to be a two-dimensional array of characters, so don't just print the triangle! - */ public char[][] generateTriangle(int n) { + char[][] Triangle = new char[n][]; - // todo - return null; + for(int i=0; i