TGTGInsighttelegram intelligenceLIVE / telegram public index
Innhold
Innholdet i innlegget
// problem 8 ofstream fnum("numbers.txt"); int k; for (int i = 0; i < 100; i++) { k = rand() % 100+1; fnum << k << endl; } fnum.close(); ifstream fmax("numbers.txt"); int num, max = 0; while (fmax>>num) { if (max < num) { max = num; } } cout << max << endl; fmax.close();