|
|
back to boardHow to stop please HELP me PLEASE (I think it doesn't work) there is Crush #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main(){ long a; double b[100000]; int i=0; cin>>a; while(a!=EOF){ if (a>=0) {b[i]=sqrt((double)a);i++;} else continue; cin>>a; } cout.setf(ios::fixed); cout.setf(ios::showpoint); for(int j=i-1;j>=0;j--) cout<<setprecision(4)<<b[i]<<endl; return 0; } while(a!=EOF) - incorrect condition, read in FAQ how to input normally (-) And please check your solution at least on sample test before posting on board. |
|
|