#include <iostream>
struct Bigint
{
int len;
int a[150005];
Bigint(int x)
{
for (len = 1; x != 0; len++)
{
a[len] = x % 10;
x /= 10;
}
len--;
}
int &operator[](int i) { return a[i]; }
void flatten(int l)
{
len = l;
for (int i = 1; i <= len; i++)
{
a[i + 1] += a[i] / 10;
a[i] %= 10;
}
while (a[len] == 0 && len > 1)
len--;
}
friend std::ostream &operator<<(std::ostream &output, const Bigint &x)
{
for (int i = x.len; i >= 1; i--)
std::cout << x.a[i];
return output;
}
friend std::istream &operator>>(std::istream &input, Bigint &x)
{
std::string str;
std::cin >> str;
x.len = 0;
for (int i = 0; i < str.length(); i++)
x.a[++x.len] = str[str.length() - i - 1] - '0';
return input;
}
void operator=(const Bigint &y)
{
len = y.len;
for (int i = 1; i <= len; i++)
a[i] = y.a[i];
}
friend Bigint operator+(Bigint a, Bigint b)
{
Bigint res(0);
for (int i = 1; i <= std::max(a.len, b.len); i++)
res[i] = a[i] + b[i];
res.flatten(std::max(a.len, b.len) + 1);
return res;
}
friend bool operator<=(Bigint a, Bigint b)
{
if (a.len < b.len)
return true;
for (int i = a.len; i >= 1; i--)
if (a.a[i] < b.a[i])
return true;
return (a.a[1] <= b.a[1]);
}
};
Bigint n(0), a(1), b(1), c(1);
int main()
{
// freopen("data.in", "r", stdin);
// freopen("lzy.out", "w", stdout);
// std::ios::sync_with_stdio(false);
// std::cin.tie(nullptr);
// std::cout.tie(nullptr);
std::cin >> n;
c = a + b;
while (c <= n)
{
a = b;
b = c;
c = a + b;
}
std::cout << a << " " << b << " " << c << " " << n << "\n";
return 0;
}
问号两行任意注释一个就能输入,留下来就输入都输不了。请问这是什么鬼?