Advertisement
Guest User

Homeworrk

a guest
Feb 11th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. int a=2;
  9. int insrt;
  10. char x;
  11. do{
  12.  
  13.  
  14. cout<<"Positionierung von "<<a-1<<"auf"<<endl;
  15. cout <<"insuuert";
  16. cin>>insrt;
  17.  
  18.  
  19. if (insrt>=1 && insrt <=8)
  20. {
  21. for (a;a<=insrt;a++)
  22. {
  23. cout <<"position"<< a << endl;
  24. }
  25. }
  26.  
  27.  
  28. for (a;a<=insrt;a--)
  29. {
  30. cout<<"position"<<a<<endl;
  31. }
  32.  
  33. else
  34. {
  35. cout<<"wrong insrt"<< endl;
  36. }
  37. cout<< " neue position inserten?(j/n) "<<endl;
  38. cin>>x;
  39. }while (x=='j');
  40.  
  41. system("PAUSE");
  42. return EXIT_SUCCESS;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement