/* Challenge 004 Challenge #1 Write a script to output the same number of PI digits as the size of your script. Say, if your script size is 10, it should print 3.141592653. https://crypto.stanford.edu/pbc/notes/pi/code.html */ #include #include #include using namespace std; ostringstream buf;int a=10000,b,c=2800,d,e,f[2801],g; int main(int argc,char**argv){ for(;b-c;)f[b++]=a/5; for(;d=0,g=c*2;c-=14,(buf<='5'){for(b=a-1;b>0;b--){ s[b]++;if(s[b]<='9')break;s[b]--;}};s.resize(a); cout<