Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication1.cpp : Ten plik zawiera funkcję „main”. W nim rozpoczyna się i kończy wykonywanie programu.
- //
- #include "pch.h"
- #include <iostream>
- using namespace std;
- void sort(int *tab, int size) {
- if (size < 2) return;
- if (*tab > *(tab + 1)) {
- int tmp = *tab;
- *tab = *(tab + 1);
- *(tab + 1) = tmp;
- }
- sort(tab + 1, size - 1);
- return;
- }
- struct time {
- string day;
- int hour;
- int min;
- int sec;
- };
- int main()
- {
- string dni[]={ "pon","sro","sob","wto","pio" };
- int godz[] = { 2,3,5,4,3};
- int min[] = { 32,47,29,19,55};
- int sec[] = { 20,30,10,40,25};
- time rob;
- int tabl[] = { 14,33,27,78,45};
- int *ptab = &tabl[0];
- int k = sizeof(tabl) / sizeof(int);
- //for (int n = 0; n < k; n++) {
- // cout << tabl[n];
- // cout << " ";
- //}
- cout << endl;
- for (int m = k; m > 0; m--)
- sort(ptab, m);
- /*for (int n = 0; n < k; n++) {
- cout << tabl[n];
- cout << " ";
- }*/
- cout << endl;
- for (int k = 0; k < 5; k++) {
- rob.day = dni[k];
- rob.hour = godz[k];
- rob.min = min[k];
- rob.sec = sec[k];
- projektX.push_back(rob);
- }
- vector<time> projektX;
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement