返回列表 發帖
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    int x;
  6.    cout<<"歡迎進入炫宗的圓面積計算程式"<<endl;
  7.    cout<<"請輸入圓形半徑"<<endl;
  8.    cin>>x;
  9.    cout<<"您輸入的數字是"<<x<<endl;
  10.    cout<<"答案是..."<<endl;
  11.    cout<<x<<"*"<<x<<"*3.14="<<x*x*<<endl;


  12.    system("pause");
  13.    return 0;
  14. }
複製代碼

TOP

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    int x;
  6.    int y;
  7.    cout<<"歡迎進入炫宗的三角形面積計算程式"<<endl;
  8.    cout<<"請輸入長"<<endl;
  9.    cin>>x;
  10.    cout<<"請輸入高"<<endl;
  11.    cin>>y;
  12.    cout<<"您輸入的長是"<<x<<"您輸入的高是"<<y<<endl;
  13.    cout<<"答案是..."<<endl;
  14.    cout<<x<<"*"<<y<<"/2="<<x*y/2<<endl;


  15.    system("pause");
  16.    return 0;
  17. }
複製代碼

TOP

返回列表