Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Oef_subroutine_2 {
- static void tekenDriehoek (int h, char symb) {
- for (int i = 1; i <= h; i++) {
- for (int k = 0; k < h-i; k++) {
- System.out.print(" ");
- }
- for (int j = 0; j < i; j++) {
- System.out.print(symb);
- System.out.print(" "); //spaties tussen ieder teken
- }
- System.out.println("");
- }
- }
- public static void main (String[] args) {
- int hoogte;
- char symbool;
- hoogte= Invoer.leesInt("Geef het aantal regels in");
- symbool= Invoer.leesChar("Geef het symbool in");
- tekenDriehoek(hoogte, symbool);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement