maxtemp.cpp

来自「C++ 这是国外计算机科学教材系列《big C++》书籍的源代码ch4」· C++ 代码 · 共 29 行

CPP
29
字号
#include <iostream>

using namespace std;

int main()
{  
   double next;
   double highest;

   cout << "Please enter the temperature values:\n";
   if (cin >> next)
      highest = next;
   else
   {  
      cout << "No data!\n";
      return 1;
   }

   while (cin >> next)
   {  
      if (next > highest)
         highest = next;
   }

   cout << "The highest temperature is " << highest << "\n";

   return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?