OOP HomeWork

This commit is contained in:
e2hang
2025-08-11 00:01:30 +08:00
commit e8a5ca2363
119 changed files with 3187 additions and 0 deletions

14
oop_hw1/oop_hw1_7/fib.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include <iostream>
long& smaller(long& a, long& b) { return (a < b) ? a : b; }
long& bigger(long& a, long& b) { return (a >= b) ? a : b; }
void fibe(int count) {
long a = 1, b = 1;
for (int i = 0; i < count; i++) {
long& min = smaller(a, b);
long& max = bigger(a, b);
min = a + b;
std::cout << max << " ";
}
std::cout << std::endl;
}