feat: implement CPP05 C++20 card

This commit is contained in:
user
2026-07-21 20:11:42 +02:00
commit e332572a3e
38 changed files with 7623 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
#include <iostream>
class Rectangle { public: Rectangle(int width, int height) : width_{width}, height_{height} {} int area() const { return width_ * height_; } void scale(int factor) { width_ *= factor; height_ *= factor; } private: int width_; int height_; };
int main() { Rectangle rectangle{6, 4}; const int before = rectangle.area(); rectangle.scale(2); std::cout << "area=" << before << " scaled=" << rectangle.area() << '\n'; }