Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
5700 | 翟** | 13求7个数的最大值 | C++ | Accepted | 0 MS | 264 KB | 328 | 2024-12-14 09:36:52 |
#include<iostream> #include<algorithm> #include<limits.h> using namespace std; int main(){ int _max=INT_MIN; int temp; for(int i=1;i<=7;i++){ cin>>temp; if(temp>_max) swap(temp,_max);//交换t和_max的值 } cout<<_max*_max<<endl; cout<<_max*_max*_max<<endl; return 0; }