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 <math.h> void main() { int a = 0, i = 0; cin >> a; float * x = new float [ a ]; float * y = new float [ a ]; for ( int j = 0; j < a; j++ ) { x [ j ] = 0; y [ j ]= 0; } for ( ; i < a; i++ ) { cin >> x [ i ] >> y [ i ]; } i = 0; while ( i < a ) { float k = 0; while ( 1 ) { k += 1; float b = sqrt ( 100 * k / 3.14 ); if ( b > x [ i ] && b > y [ i ] ) { cout << "Property " << i + 1 << ": This property will begin eroding in year " << k << "." << endl; i += 1; break; } } } cout << "END OF OUTPUT."; delete [] x; delete [] y; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator