|
|
вернуться в форумwhy first AC and second NOT? first is: int main() { using namespace std; vector<unsigned long long> dataVec; unsigned long long input; while (cin>>input) { dataVec.push_back(input); } vector<unsigned long long>::reverse_iterator rIter;
cout.setf(ios_base::fixed); cout.setf(ios_base::showpoint); for (rIter = dataVec.rbegin(); rIter != dataVec.rend(); ++rIter) { cout<<setprecision(4) <<sqrt((double)(*rIter))<<endl; } return 0; } second is : int main() { using namespace std; vector<unsigned long long> dataVec; string lineStr; while(!getline(cin, lineStr).eof()) { unsigned long long tmp = 0; stringstream ss(lineStr); while(ss>>tmp) dataVec.push_back(tmp); } vector<unsigned long long>::reverse_iterator rIter;
cout.setf(ios_base::fixed); cout.setf(ios_base::showpoint); for (rIter = dataVec.rbegin(); rIter != dataVec.rend(); ++rIter) { cout<<setprecision(4) <<sqrt((double)(*rIter))<<endl; } return 0; } |
|
|