Anonymous
Anonymous asked in 電腦與網際網路程式設計 · 2 decades ago

C 幫我看一下哪裡錯了

#include <iostream>

using namespace std;

int main()

{

const double RATE = 6.9;

double deposit;

cout << "Enter the amount of your deposit $";

cin >> deposit;

double newBalance;

newBalance = deposit deposit*(RATE/100);

cout << "In one year, that deposit will grow to\n";

<< "$" << newBalance << " an amount worth waiting for.\n";

return 0;

}

請哪位高手幫忙看一下,謝謝嚕!!

1 Answer

Rating
  • 2 decades ago
    Favorite Answer

    << "$" << newBalance << " an amount worth waiting for.\n";

    應該改成下面的樣子

    cout<< "$" << newBalance << " an amount worth waiting for.\n";

    如果不要加cout 上一行的;應該要去除!!如下:

    cout << "In one year, that deposit will grow to\n"

    << "$" << newBalance << " an amount worth waiting for.\n";

    Source(s): Myself
Still have questions? Get your answers by asking now.