Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import acm.program.*;
- public class Askisi2 extends Program {
- public void run() {
- int n = readInt("Enter tne size of triangle: ");
- println("The triangle is: ");
- subthetiko(n);
- }
- String subthetiko(int n)
- {
- if (n==0)
- {
- return "\n" ;
- }
- else
- {
- String z = subthetiko(n - 1) + "*";
- println( z + "\n" );
- return z;
- }
- }
- }
Add Comment
Please, Sign In to add comment