Code:
void hello (int x, int y)
{
int i,z;
for (i=1;i<y;i++) {
for (z=1;z<x;z++) cout << "Hello! ";
cout << endl;
}
}
Müsste es nicht folgendermaßen heißen:
Code:
void hello (int x, int y)
{
int i,z;
for (i=0;i<y;i++) {
for (z=0;z<x;z++) cout << "Hello! ";
cout << endl;
}
}
oder
Code:
void hello (int x, int y)
{
int i,z;
for (i=1;i<=y;i++) {
for (z=1;z<=x;z++) cout << "Hello! ";
cout << endl;
}
}
Sonst fehlt ja immer eine Spalte/Zeile. Und bitte nicht
getchar() verwenden, sondern die Funktionen aus
std::cin.