Autor Beitrag
acer5672
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: So 25.11.07 13:59 
Hi unswar habe ich folgendes Problem ich hab zwar ein Weinachtsbaum hingekriegt doch er muss zentriert sein
so wie auf dem Bild: img514.imageshack.us...hp?image=baumcw4.png

hier ist mein code ,bitte um hilfe!!!

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
for (int x = 100; x >= 0; x--)
        {    
            Console.Write(" x");
            

            if (x == 100 || x == 99 || x == 96 || x == 93 || x == 88 || x == 83 || x == 76 || x == 69 || x == 60 ||
                 x == 51 || x == 40 || x == 29 || x == 16 || x == 3 || x == 2 || x == 1)
            {
               
                Console.Write("\n");
                
            }
        }
        Console.ReadLine();


Moderiert von user profile iconChristian S.: Überflüssige Leerzeilen entfernt
O5IRI5
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 36
Erhaltene Danke: 2

XP/Vista
C# (VS 2005) , eclipse
BeitragVerfasst: So 25.11.07 18:36 
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
string s = "";

            for (int i = 0; i <= 10; i++)
            {
                for (int j = 10; j >=i; j--)
                {
                    s = s + " ";
                }
                for (int k = 0; k <= i; k++)
                {
                    s = s + "x ";
                    
                }
                Console.WriteLine(s);
                s = "";
            }



LG
Harry
acer5672 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: So 25.11.07 20:49 
Schön und gut ich möchte das aber für mein code haben.