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 |
printf和cout混用,缓冲区不同,一个有,一个没有,出错正常。In Reply To:WA 原因WHY! Posted by:123456sb at 2007-08-15 22:41:39 > WA 的!@ > #include<iostream.h> > #include<stdio.h> > #include<math.h> > void main(){ > int number,n; > double R,r,temp; > double re[10000]; > cin>>number; > for(int i=1;i<=number;i++){ > cin>>R>>n; > r=(sin(acos(-1)/n)*R)/(1+sin(acos(-1)/n)); > re[i]=r; > } > for(i=1;i<=number;i++){ > //printf("Scenario #%d:\n",i); > cout<< "Scenario #"<<i<<":"<<endl; > printf("%.3f\n\n",re[i]); > } > } > AC 的!@ > #include<iostream.h> > #include<stdio.h> > //#define pi 3.14159265358979323846 > #include<math.h> > void main(){ > int number,n; > double R,r,temp; > double re[10000]; > cin>>number; > for(int i=1;i<=number;i++){ > cin>>R>>n; > r=(sin(acos(-1)/n)*R)/(1+sin(acos(-1)/n)); > re[i]=r; > } > for(i=1;i<=number;i++){ > printf("Scenario #%d:\n",i); > //cout<< "Scenario #"<<i<<":"<<endl; > printf("%.3f\n\n",re[i]); > } > } > Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator