#include #include using namespace std; int main() { fstream fi; fi.open("/home/www/class/een318/mystery.dat", ios::in | ios::binary); if (fi.fail()) { cerr << "not open\n"; exit(1); } short int a[600]; while (true) { fi.read((char *)a, sizeof(a)); if (fi.gcount() <= 0) break; for (int i = 0; i < 600; i += 10) if (a[i] > 0) cout << "x"; else if (a[i] == -500) cout << "."; else cout << "@"; cout << "\n"; fi.seekg(9 * sizeof(a), ios::cur); } fi.close(); }