📄 stone.cpp
字号:
// stone.cpp -- user-defined conversions
// compile with stonewt.cpp
#include <iostream>
#include "stonewt.h"
const int arraySize = 6;
int main()
{
using std::cout;
using std::endl;
using std::cin ;
Stonewt compare(11,0);
Stonewt max;
Stonewt min;
int biger = 0;
double temp;
Stonewt weight[6] = { 260, (285.7), (21, 8) };
for( int i = 3; i < arraySize; i++ )
{
cout<<"请输入体重(pounds):";
cin>>temp;
weight[i] = temp;
}
max = min = weight[0];
for( i = 0; i < arraySize; i++ )
{
cout<<weight[i]<<endl;
max = ( max<weight[i] ) ? weight[i] : max;
min = ( min>weight[i] ) ? weight[i] : min;
if( compare == weight[i] )
++biger;
}
cout<<"max:\t"<<max<<endl;
cout<<"min:\t"<<min<<endl;
cout<<"biger than "<<compare<<": "<<biger<<endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -