真有点被唬住了……貌似现在32位计算机上的int和long都是4个字节,也就是32位,这道题直接做就好……
Run Time: 0sec
Run Memory: 312KB
Code length: 321Bytes
SubmitTime: 2012-02-02 22:50:15
// Problem#: 1157
// Submission#: 1204725
// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/
// All Copyright reserved by Informatic Lab of Sun Yat-sen University
#include <iostream>
using namespace std;
int main()
{
int n;
int data, max;
while ( cin >> n && n ) {
cin >> max;
for ( int i = 1; i < n; i++ ) {
cin >> data;
if ( data > max )
max = data;
}
cout << max << endl;
}
return 0;
}
本文讨论了在32位计算机上处理int和long数据的问题,通过简单的程序实现来解决最大值查找任务。
306

被折叠的 条评论
为什么被折叠?



