#include <iostream> using namespace std; int main(void) { const int SIZE = 100; int height[SIZE], num[SIZE], n, ans; cin >> n; for (int i = 0; i < n; i++) { cin >> height[i]; num[i] = 1; for (int j = 0; j < i; j++) { if ((height[j] < height[i]) && (num[j] >= num[i])) num[i] = num[j] + 1; } } ans = 0; for (int i = 0; i < n; i++) { if (num[i] > ans) ans = num[i]; } cout << ans << endl; } 输入: 6 2 5 3 11 12 4 输出:1
区块链毕设网qklbishe.com为您提供问题的解答
#include <iostream> using namespace std; int main(void) { const int SIZE = 100; int height[SIZE], num[SIZE], n, ans; cin >> n; for (int i = 0; i < n; i++) { cin >> height[i]; num[i] = 1; for (int j = 0; j < i; j++) { if ((height[j] < height[i]) && (num[j] >= num[i])) num[i] = num[j] + 1; } } ans = 0; for (int i = 0; i < n; i++) { if (num[i] > ans) ans = num[i]; } cout << ans << endl; }
输入:
6
2 5 3 11 12 4
输出:1
4
22:44
以上就是关于问题#include <iostream> using namespace std; int main(void) { const int SIZE = 100; int height[SIZE], num[SIZE], n, ans; cin >> n; for (int i = 0; i < n; i++) { cin >> height[i]; num[i] = 1; for (int j = 0; j < i; j++) { if ((height[j] < height[i]) && (num[j] >= num[i])) num[i] = num[j] + 1; } } ans = 0; for (int i = 0; i < n; i++) { if (num[i] > ans) ans = num[i]; } cout << ans << endl; } 输入:
6
2 5 3 11 12 4
输出:1的答案
欢迎关注区块链毕设网-
专业区块链毕业设计成品源码,定制。
区块链NFT链游项目方科学家脚本开发培训
从业7年-专注一级市场
微信:btc9767
TELEGRAM :https://t.me/btcok9
具体资料介绍
web3的一级市场千万收益的逻辑
进群点我
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » #include <iostream> using namespace std; int main(void) { const int SIZE = 100; int height[SIZE], num[SIZE], n, ans; cin >> n; for (int i = 0; i < n; i++) { cin >> height[i]; num[i] = 1; for (int j = 0; j < i; j++) { if ((height[j] < height[i]) && (num[j] >= num[i])) num[i] = num[j] + 1; } } ans = 0; for (int i = 0; i < n; i++) { if (num[i] > ans) ans = num[i]; } cout << ans << endl; } 输入:
6
2 5 3 11 12 4
输出:1
微信:btc9767
TELEGRAM :https://t.me/btcok9
具体资料介绍
web3的一级市场千万收益的逻辑
进群点我
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » #include <iostream> using namespace std; int main(void) { const int SIZE = 100; int height[SIZE], num[SIZE], n, ans; cin >> n; for (int i = 0; i < n; i++) { cin >> height[i]; num[i] = 1; for (int j = 0; j < i; j++) { if ((height[j] < height[i]) && (num[j] >= num[i])) num[i] = num[j] + 1; } } ans = 0; for (int i = 0; i < n; i++) { if (num[i] > ans) ans = num[i]; } cout << ans << endl; } 输入:
6
2 5 3 11 12 4
输出:1
进群点我
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » #include <iostream> using namespace std; int main(void) { const int SIZE = 100; int height[SIZE], num[SIZE], n, ans; cin >> n; for (int i = 0; i < n; i++) { cin >> height[i]; num[i] = 1; for (int j = 0; j < i; j++) { if ((height[j] < height[i]) && (num[j] >= num[i])) num[i] = num[j] + 1; } } ans = 0; for (int i = 0; i < n; i++) { if (num[i] > ans) ans = num[i]; } cout << ans << endl; } 输入:
6
2 5 3 11 12 4
输出:1
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » #include <iostream> using namespace std; int main(void) { const int SIZE = 100; int height[SIZE], num[SIZE], n, ans; cin >> n; for (int i = 0; i < n; i++) { cin >> height[i]; num[i] = 1; for (int j = 0; j < i; j++) { if ((height[j] < height[i]) && (num[j] >= num[i])) num[i] = num[j] + 1; } } ans = 0; for (int i = 0; i < n; i++) { if (num[i] > ans) ans = num[i]; } cout << ans << endl; } 输入: 6 2 5 3 11 12 4 输出:1