返回列表 發帖
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int y;
  6.     cout<<"請輸入您要的半徑(單位:公分)"<<endl;
  7.     cin>>y;
  8.     cout<<y<<"*"<<y<<"*3.14="<<y*y*3.14<<endl;
  9.     system("pause");
  10.     return 0;
  11. }
複製代碼

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

返回列表