I was pointed to a blog post about some new features in C++, the first language that I learnt when I started programming 15 years ago.
The author, a member of the C++ Standardization Committee, gives us an example of some basic algorithm to illustrate the use of a new C++ feature that he worked on. The task is rather simple: find triplets of integers a
, b
and c
where a²+b²=c²
. Here are some examples:
3 4 5 because 3*3+4*4 = 9+16 = 25 = 5*5
6 8 10 because 6*6+8*8 = 36+64 = 100 = 10*10
5 12 13 because 5*5+12*12 = 25+144 = 169 = 13*13