5_5 & 5_6
This commit is contained in:
parent
4d9daac7c5
commit
1d817947d6
|
@ -0,0 +1,14 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
|
||||||
|
T maxx(T a, T b) {
|
||||||
|
return a > b ? a : b;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cout << maxx("bdc", "bcd");
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
template<class T, class T1>
|
||||||
|
|
||||||
|
T wypiszTablice(vector<T> tab, T1 a) {
|
||||||
|
//cout << sizeof(tab);
|
||||||
|
for (int i = 0; i < tab.size(); i++) {
|
||||||
|
cout << tab[i] << " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
return tab[a];
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
vector<int> tab1 = {2, 3, 7, 11, 17};
|
||||||
|
vector<double> tab2 = { 3.14, 6.11, 7.87, 11.21, 19.91 };
|
||||||
|
vector<char> tab3 = { 'A', 'B', 'c', 'X', '5' };
|
||||||
|
|
||||||
|
//cout << sizeof(tab1);
|
||||||
|
|
||||||
|
cout << wypiszTablice(tab1, 2) << endl;
|
||||||
|
cout << wypiszTablice(tab2, 2) << endl;
|
||||||
|
cout << wypiszTablice(tab3, 2) << endl;
|
||||||
|
}
|
|
@ -139,7 +139,9 @@
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="ConsoleApplication1.cpp" />
|
<ClCompile Include="5_5.cpp" />
|
||||||
|
<ClCompile Include="5_4.cpp" />
|
||||||
|
<ClCompile Include="5_6.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|
|
@ -15,7 +15,13 @@
|
||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="ConsoleApplication1.cpp">
|
<ClCompile Include="5_4.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="5_5.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="5_6.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
Loading…
Reference in New Issue