Advertisement
Farjana_akter

Untitled

Mar 18th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long int ll;
  4.  
  5.  
  6. void funA(int n)
  7. {
  8. int i,j,k;
  9.  
  10. for(i=1;i<=n;i++)
  11. {
  12. cout<<"sin(";
  13. cout<<i;
  14. if(i%2==0 && i!=n)
  15. {
  16. cout<<"+";
  17. }
  18. else if(i%2==1 && i!=n)
  19. {
  20. cout<<"-";
  21. }
  22. }
  23. for(i=1;i<=n;i++)
  24. cout<<")";
  25. }
  26.  
  27. int main()
  28. {
  29. int n,i,j,k,a,b,c,d;
  30. cin>>n;
  31. for(i=1;i<n;i++)
  32. cout<<"(";
  33. for(i=1;i<=n;i++)
  34. {
  35. funA(i);
  36. cout<<"+"<<n-i+1;
  37. if(i!=n)
  38. cout<<")";
  39. }
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement