Guest User

Untitled

a guest
Dec 15th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,a=0,b=0,c=0;
  8.  
  9. cout <<"Podaj liczbe n"<<endl;
  10. cin >>n;
  11.  
  12. for(a=0;a<=n;++a)
  13. {
  14. cout<<a;
  15. }
  16.  
  17. for(a=n;a>=0;a--)
  18. {
  19. cout<<a;
  20. }
  21.  
  22. while(b<=n)
  23. {
  24. cout<<b;
  25. b++;
  26. }
  27.  
  28. while(b>=0)
  29. {
  30. cout<<b;
  31. b--;
  32. }
  33.  
  34.  
  35. do
  36. {
  37. cout<<c;
  38. c++;
  39. }
  40. while(c<=n);
  41.  
  42.  
  43. do
  44. {
  45. cout<<c;
  46. c--;
  47. }
  48. while(c>=0);
  49.  
  50. }
Add Comment
Please, Sign In to add comment