Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
谁帮我看看这个解法错在哪里啊??#include <iostream.h> #include <iomanip.h> void main() { int count=0; long n; long b; long* array=&b; do {float a; cin>>setprecision(3)>>a; cout<<"\n"; n=1; if(a!=0.00) { if(a>=0.01&&a<=5.20) {while(a>0){ n=n+1; a=a-(1.0/n);} n=n-1; array[count]=n; count++; } else return; } else break; }while(true); int i=0; for(;i<count;i++) cout<<array[i]<<"\n"; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator