Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Progress bar
div64 inline asm
Preserving strict aliasing Union example
Attribute of qi parsers
Catching divide-by-zero with /EHc
RTTI Test
CStringA
std::is_same doesn't check for calling convention
DCapSurfaceDesc
Use std::is_base_of to subset STL container contents.
Please log in to post a comment.