So, ein tolles Programm, was 1->10->1->10 hoch- und runterzählt.PHP-Code:#include <iostream>
using namespace std;
int main()
{
int x,d=-1,s=1;
for(x=1;x>0; x+=d)
{
cout << x << " ";
if((s<=4)&&((x==1)||(x==10)))
{
d=-d;
s++;
}
}
cout << endl;
return(0);
}
Kann mir bitte mal einer sagen was x+=d bedeutet? Ich glaub ich steh echt auf der Leitung, aber ich schnall es einfach ned![]()
Danke!





Zitieren

Lesezeichen