Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
blad-z-obcinaniem-koncowek
//clang 6.0.0 #include <iostream> #include <cstring> using namespace std; char* usun_spacje(char* tekst) { int i = 0; while (tekst[strlen(tekst)-i] == ' ') { i++; } tekst[strlen(tekst)] = '\0'; while (* tekst == ' ') { for (int j = 0; j <= strlen(tekst); j++) { tekst[j] = tekst[j + 1]; } } int dlugosc = strlen(tekst); return tekst; } int main() { char teksty[6][50] = { " prawo i lewo ", "prawo ", " lewo", " ", "", "bez usuwania" }; for (int i = 0; i < 6; i++) { cout << "[" << usun_spacje(teksty[i]) << "]" << endl; } }
run
|
edit
|
history
|
help
0
Dec to Bin
Roger Cheng
Flowchart segitiga
Matrix rotation
map sort
dodawanie "MIECIERZY"
insertion_sort
11
11
Pairs having sum equal to target