-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Problem] Pythagorean triplet #37
Comments
@Legoeggolas Your code doesn't work on g++ and clang. Update the project with your working code. |
Double checked, works just fine for me. |
It's not my issue. I tried my linux machines. It's not working. [onur@archlinux pythagorean_triplet]$ clang solution.cpp More detailed info: |
@onurbbr You're supposed to either include the header (where a function is provided) and compile with that, or uncomment the main function (and necessary includes) in the header and source files. |
Activating main does not change the result. This time I'm getting a namespace error. When I enable Namespace, the linker cannot link the code you wrote. |
[onur@archlinux pythagorean_triplet]$ clang solution.cpp When I enable std and iostream it gives another linker error. [onur@archlinux pythagorean_triplet]$ clang solution.cpp Error details (--verbose) |
I tried ubuntu server and ubuntu docker image. The result is the same. root@ubuntu:~# clang solution.cpp |
@onurbbr After you have added the appropriate include in the header file and uncommented the main function, it should compile properly. |
Hmm. I tried with ubuntu vm and it worked. That's weird because my main machine is not compiling this code. Anyway problem is my main machine. It works on Raspberry Pi 4 too. Sorry for misunderstanding. EDIT: My machine linked clang++ as clang. I don't know how this happened. A strange situation has arisen. I am sorry for this. Thanks for your time. Have a nice day, keep coding! |
@onurbbr |
Pythagorean triplet
Pythagorean triplet is a set of three natural numbers where a < b < c.
There is exactly one Pythagorean triplet for which$a + b + c = 1000$ .
The text was updated successfully, but these errors were encountered: