diff --git a/sources/hash_map.cc b/sources/hash_map.cc index f6b66b2..c2c4c98 100644 --- a/sources/hash_map.cc +++ b/sources/hash_map.cc @@ -10,7 +10,7 @@ #include #include #include - +#include /* * n: number * i: LSB starting from 1 @@ -31,34 +31,36 @@ using namespace std; int test = 0, pass = 0; -void assert(bool result) { +int checks(bool result) { test++; pass+=result; - cout << (result ? "PASS: " : "FAIL: "); + cout << (result ? "PASS " : "FAIL ")<<"\n"; + + return 0; } int main() { ios::sync_with_stdio(false); - __gnu_cxx::hash_map months; - - months["january"] = 31; - months["february"] = 28; - months["march"] = 31; - months["april"] = 30; - months["may"] = 31; - months["june"] = 30; - months["july"] = 31; - months["august"] = 31; - months["september"] = 30; - months["october"] = 31; - months["november"] = 30; - months["december"] = 31; + map months; - ASSERT(months["september"]==30) - ASSERT(months["august"]==31) + months["January"] = 31; + months["February"] = 28; + months["March"] = 31; + months["April"] = 30; + months["May"] = 31; + months["June"] = 30; + months["July"] = 31; + months["August"] = 31; + months["September"] = 30; + months["October"] = 31; + months["November"] = 30; + months["December"] = 31; + + checks(months["September"]==30); + checks(months["August"]==31); cout << "Passed: " << pass << " (" << 100.0*pass/test << "%%)" << endl; return 0; -} \ No newline at end of file +} diff --git a/sources/hash_map.exe b/sources/hash_map.exe new file mode 100644 index 0000000..7bc7c94 Binary files /dev/null and b/sources/hash_map.exe differ diff --git a/sources/hash_map.o b/sources/hash_map.o new file mode 100644 index 0000000..879055a Binary files /dev/null and b/sources/hash_map.o differ diff --git a/sources/list.cc b/sources/list.cc index e8e6cac..1bf0ec7 100644 --- a/sources/list.cc +++ b/sources/list.cc @@ -5,14 +5,15 @@ using namespace std; int main() { list ll; - ll.push_back(1); - ll.push_back(2); - ll.push_back(3); - ll.push_back(4); + int n; + cin>>n; + for(int i=1;i::iterator li = ll.begin(); li != ll.end(); li++) { cout << *li << endl; } return 0; -} \ No newline at end of file +} diff --git a/sources/list.exe b/sources/list.exe new file mode 100644 index 0000000..3f33183 Binary files /dev/null and b/sources/list.exe differ diff --git a/sources/list.o b/sources/list.o new file mode 100644 index 0000000..710ce5a Binary files /dev/null and b/sources/list.o differ