Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
#33
#include <iostream> #include <string> #include <fstream> using namespace std; bool wczytajPlik() { ifstream plik; plik.open("input.txt"); if (!plik.good()) return false; int suma; while (true) { int a; plik >> a; cout << "[" << a << "] " << a << endl; suma += a; if (!plik.good()) break; } cout << "Suma: " << suma << endl; return true; } int main() { if(!wczytajPlik()) cout << "Blad otwierania pliku!" << endl; return 0; } // do tego potrzebny jest plik input.txt z liczbami oddzielonymi spacja
run
|
edit
|
history
|
help
0
#9
students grade
Is a Union Member's Destructor Called
Multi Inheritance
MSVC ignoring unknown attributes
!Enum
Affine Key Finder and Decrypter
define own struct
ordinary queue
Attribute of qi parsers