```cpp
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int a = 0; a <= n; a++) { int b = n - a; if (b >= 0 && b <= INT_MAX) { cout << a << " " << b << endl; } } return 0;
}
```
#include <iostream>
int main() {
int n;
std::cout << "Nhap so tu nhien n (0 <= n <= 100): ";
std::cin >> n;
int a, b;
// Chia n thành hai phần bằng nhau
a = n / 2;
b = n - a;
std::cout << "Hai so nguyen a va b thoa man a + b = " << n << " la: " << a << " " << b << std::endl;
return 0;
}