怎么解决呀大佬们
不会呀{:10_254:} C 代码:#include <stdio.h>int main()
{
int price = {7, 1, 5, 3, 6, 4};
int profit = 0;
for(size_t i = 0; i < 5; i++)
for(size_t j = i+1; j < 6; j++)
profit = profit < price-price ? price-price : profit;
printf("%d", profit);
return 0;
}Python 代码:price =
profit = 0
for i in range(len(price)-1):
for j in price:
profit = max(profit, j-price)
print(profit)输出:5 傻眼貓咪 发表于 2021-11-21 13:27
C 代码:Python 代码:输出:
谢谢猫咪{:10_254:} 傻眼貓咪 发表于 2021-11-21 13:27
C 代码:Python 代码:输出:
哇塞python的就那么一点{:10_254:} {:7_125:}
页:
[1]