This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdlib> | |
| #include <ctime> | |
| #include <cstdio> | |
| #include <windows.h> | |
| #include <chrono> | |
| using namespace std; | |
| void bubblesort(int tab[], int n) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdlib> | |
| using namespace std; | |
| void selection_sort(int tab[], int n) | |
| { | |
| int mn_index; | |
| for(int i=0; i<n-1; i++) | |
| { | |
| mn_index = i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdlib> | |
| using namespace std; | |
| int *pom; | |
| void scal(int tab[], int lewy, int srodek, int prawy) | |
| { | |
| int i = lewy, j = srodek + 1; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| void quick_sort(int *tab, int lewy, int prawy) | |
| { | |
| if(prawy <= lewy) return; | |
| int i = lewy - 1, j = prawy - 1; | |
| int pivot = tab[(lewy + prawy)/2]; //punkt odniesienia | |
| while(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdlib> | |
| using namespace std; | |
| void bubblesort(int tab[], int n) | |
| { | |
| for(int i=0; i<n;i++) | |
| for(int j=1; j < n-i; j++) | |
| if(tab[j-1] > tab[j]) | |
| swap(tab[j-1], tab[j]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <chrono> | |
| #include <cstdlib> | |
| #include <cstring> | |
| #include <malloc.h> | |
| const int SIZE = 1024*1024; | |
| void measure( const char *name, char *ptr ) { | |
| std::cout << "measuring for " << name << " (addr: " << static_cast<void*>(ptr) << ")\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| double R; | |
| double nominaly[] = {100, 50, 20, 10, 5, 2, 1}; | |
| cout << "Wprowadz reszte: "; | |
| cin >> R; | |
| for(int i=0; i<7; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| enum e_brand{bmw = 1, audi, opel, peugeot, seat}; | |
| enum e_color{black = 1, white, red, blue, green}; | |
| struct car | |
| { | |
| e_brand brand; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //a program that gives a sum of three-digit-numbers with different digits. | |
| #include <iostream> | |
| //#include <conio.h> | |
| int main() | |
| { | |
| int sum = 0; | |
| for (int s = 1; s <= 9; s++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int a,n,i,product; | |
| product = 1; | |
| cout << "How many numbers do you want me to multiply: "; | |
| cin >> n; |
NewerOlder