Skip to content

Commit

Permalink
try to submit homework
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicocro committed Mar 7, 2023
1 parent 767eb4d commit f7839d8
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"files.associations": {
"__bit_reference": "cpp",
"__bits": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__nullptr": "cpp",
"__split_buffer": "cpp",
"__string": "cpp",
"__threading_support": "cpp",
"__tuple": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"locale": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"variant": "cpp",
"vector": "cpp",
"algorithm": "cpp"
}
}
8 changes: 8 additions & 0 deletions 01_intro/homework/collatz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ int main()
std::getline(std::cin, line);
unsigned int Collatz_state = std::stoi(line);

if (Collatz_state == 0)
{
std::cout << "0 is not accepted, give me a better number:" << std::flush;
std::getline(std::cin, line);
unsigned int Collatz_state = std::stoi(line);
} /*this is a bit crap because it only checks once, if the user puts again 0, then it does not catch it,
but i do not know how to raise errors in c++ yet, maybe that would have been better? */

// std::cout << "Collatz Base is " << Collatz_state << std::endl;

while (Collatz_state != 1)
Expand Down

0 comments on commit f7839d8

Please sign in to comment.