Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
#32
#include <iostream> #include <fstream> using namespace std; int main() { string wiersz, szukaj; ifstream plik; // deklaracja zmiennej dla pliku plik.open("input.txt"); // otwieranie pliku do zmiennej if (!plik.good()) { cout << "Brak odczytu pliku!" << endl; return 0; } cout << "Czego wyszukac w pliku?" << endl; cin.clear(); cin.sync(); cin >> szukaj; while(getline(plik, wiersz)){ if (wiersz.find(szukaj) != string::npos) cout << wiersz << endl; } cout << "Koniec"; plik.close(); return 0; } // do tego potrzebny jest plik input.txt z jakimis wierszami // input jest wyszukiwany przez program w linijkach tekstu pliku
run
|
edit
|
history
|
help
0
Error log b is an undeclared identifier...
accessing private of different type of template
#19
virtual inheritance
constexpr internal error
zero size std::array parameter
wrong up
Two-phase sample with Visual C++ 2015
Printf %px test
Computing factorial of an integer with recursion and iteration [EDIT]