silviana_amethyst
about
gallery
reading guides
computational_projects
papers_presentations
work_blog
useful_pages
teaching
20210fall2016
6_40212spring2017
Download the exam
For Problem 2
#include
int main(int argument_count, char** arguments) { ifstream fin(datafile); fin.precision(2); ofstream fout(datafile); fout.setw{5} for (i=1; i<1000; i++) { fin >> d; if ( -1 <= d <= 1 ) fout << d; } }
% my data is in here 4.05000000000061920 -3.7301318370649392 4.100000000 1.3235924622540951 -4.0245959500059048 0.4688151920498385 4.5750683543429762 -3.4238691832245172 4.7000000 4.5716694824294564 -0.1462435127715880 3.0028046888880020 -0.7823871737372503 2.9220732955955437 4.5949242000000 1.5574069915658679 -4.6428832142581040 3.4912930586877717 1.7873515485777345 2.5000000 2.4313246812491620 -1.0777298046583184 1.55477890000000 2.0604608801960875000000000000000 -2.2307701503911002 -4.0280000000000000 1.9482862297581702 -1.8290051993913945 4.5022204883835499 -4.6555391949709124 -0.6000000000000