Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void sin(int l,int mt)
- {
- if(l+1==mt)return;
- if(mt==1)printf("sin(%d",mt);
- else if(mt%2)printf("+sin(%d",mt);
- else printf("-sin(%d",mt);
- sin(l,++mt);
- printf(")");
- }
- int main()
- {
- int q,g,w;
- scanf("%d",&q);
- for(g=1;g<q;g++)printf("(");
- for(g=1,w=q;g<q;g++){
- sin(g,1);
- printf("+%d)",w--);
- }
- sin(g,1);
- printf("+%d\n",w);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment