| ||||||||||
| 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 | |||||||||
求助,这道题怎么判断一行的结束啊???用while(scanf("%d",&i)==1){可不可啊,谢谢! int i;
cout<<setiosflags(ios::fixed);
cout<<setprecision(6);
while(scanf("%d",&i)==1){
double res[100][2];
cout<<i<<" ";
for(int j=0;j<i;j++){
scanf("%lf %lf",&res[j][0],&res[j][1]);
}
for(int k=0;k<i;k++){
for(int m=0;m<=1;m++){
cout<<((res[k%i][m]+res[(k+1)%i][m])/2)<<" ";
}
}
cout<<endl;
}
return 0;
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator