「C++ プログラミング言語」を読んでいて、現在の課題は、2 つの変数を取り、値の最小、最大、合計、差、積、および比率を決定するプログラムを作成することです。
問題は、改行を開始できないことです。引用符の後に変数があるため、「\n」は機能しません。また、「<< endl <<」は最初の行でのみ機能します。私はこの問題を徹底的にグーグル検索しましたが、不足しています。
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
inline void keep_window_open() {char ch;cin>>ch;}
int main()
{
int a;
int b;
cout<<"Enter value one\n";
cin>>a;
cout<<"Enter value two\n";
cin>>b;
(a>b); cout<< a << " Is greater than " << b;
(a<b); cout<< a << " Is less than " << b;
keep_window_open();
return 0;
}