Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void xd()
- {
- int element=3;
- int n;
- cin >> n;
- for(int i=1;i<=n;i++)
- {
- cout << element << " ";
- element = element *2;
- }
- }
- void xd2()
- {
- int element=-10;
- int n;
- cin >> n;
- for(int i=1;i<=n;i++)
- {
- cout << element << " ";
- element = element +6;
- }
- }
- void xd3()
- {
- int element=1;
- int n;
- cin >> n;
- for(int i=1;i<=n;i++)
- {
- if (i%2!=0)
- cout << element << " ";
- else
- cout << element * -1 << " ";
- element = element *2;
- }
- }
- void z1()
- {
- int i;
- cout<<"pkt A"<<endl;
- for (i =-4;i <=14;i=i+3)
- cout<<i<<" ";
- cout<<endl<<"pkt C"<<endl;
- int j;
- for (j =12;j>=-12;j=j-4)
- cout<<j<<" ";
- cout<<endl<<"pkt D"<<endl;
- int k;
- for (k=12;k>=1;k=k-3)
- cout<<k<<" ";
- if(k<3){
- k=0;
- }
- cout<<k<<" ";
- cout<<endl<<"pkt B"<<endl;
- int a;
- for(a=1;a<11;a++){
- if(a%2!=0)
- cout<<a<<" ";
- else
- cout<<a*-1<<" ";
- }
- cout<<endl<<"pkt E"<<endl;
- cout<<"1"<<" ";
- int b;
- for(b=3;b<19;b=b+3){
- if(b%2!=0)
- cout<<b*-1<<" ";
- else
- cout<<b<<" ";
- }
- }
- int main()
- {
- xd3();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement