|
|
back to boardhere my c code Posted by Sunnat 7 Apr 2012 17:28 #include<stdio.h> main() { int n,i,j; scanf("%i",&n); for(i=1;i<n;i++) printf("("); for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { if(j>1) printf((j&1)?"+":"-"); printf("sin(%i",j); } for(j=1;j<=i;j++)printf(")"); printf("+%i",n+1-i); if(i!=n)printf(")"); } } Re: here my c code Posted by BillSu 25 Apr 2014 13:26 A concise code. Much better than mine. |
|
|