Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,a=0,b=0,c=0;
- cout <<"Podaj liczbe n"<<endl;
- cin >>n;
- for(a=0;a<=n;++a)
- {
- cout<<a;
- }
- for(a=n;a>=0;a--)
- {
- cout<<a;
- }
- while(b<=n)
- {
- cout<<b;
- b++;
- }
- while(b>=0)
- {
- cout<<b;
- b--;
- }
- do
- {
- cout<<c;
- c++;
- }
- while(c<=n);
- do
- {
- cout<<c;
- c--;
- }
- while(c>=0);
- }
Add Comment
Please, Sign In to add comment