• 首頁
  • 產品
    • 所有產品
    • 歐維斯瀏覽器
  • 關於我們
facebook Email

歐維斯福利設

Always Security Blog

#include <iostream>
using namespace std;
int main()
{
    double top, bottom, height;
cout << "請輸入上底長度\n";
cin >> top;
    cout << "請輸入下底長度\n";
cin >> bottom;
    cout << "請輸入高度\n";
cin >> height;
cout << "面積是" << (top+bottom)*height/2 << endl;
return 0;
}

Share
Tweet
Share
No 意見
#include <iostream>
using namespace std;
int main()
{
    double r,pi=3.1415;
    cout<<"請輸入圓半徑:";
    cin>>r;
    cout<<endl<<r*r*pi;
    return 0;
}

Share
Tweet
Share
No 意見
#include <iostream>
using namespace std;
int main()
{
    int chinese,english,math;
    float average;    //宣告average為浮點數變數
    cout<<"請輸入國文、英文、數學成績:";
    cin>>chinese>>english>>math;  //讀入各科成績
    average = (float)(chinese+english+math)/3;    //將分數加總後除以3
    cout<<"平均分數為: "<<average<<endl;
   
    return 0;
}
Share
Tweet
Share
No 意見
#include <iostream>
using namespace std;
int main()
{
    double C,F;                         //宣告兩個浮點數變數
   
    cout<<"請輸入華氏溫度:" ;
    cin>>F;                             //將使用者輸入的數字存入變數F
    C=(F-32)*5/9;                       //使用公式轉換溫度
    cout<<"華氏 "<<F<<" 度轉為攝氏後為 "<<C<<" 度"<<endl;   //印出結果
   
    return 0;
}
Share
Tweet
Share
No 意見
#include <iostream>
using namespace std;
int main()
{
    int x;
    int y;
    int z;
   
    x=1;              //將變數x的值指定為1
    y=x+1;            //將變數y的值指定為x的值(1)加1
    z=x+y;            //將變數z的值設為x的值(1)加y的值(2)

    cout<<"x="<<x<<endl;   //x=1
    cout<<"y="<<y<<endl;   //y=2
    cout<<"z="<<z<<endl;   //z=3
     
    return 0;
}
Share
Tweet
Share
No 意見
#include <iostream>
#define rate 0.0487
using namespace std;

int main()
{
    //宣告整數myAccount
    int myAccount;    
    //印出指令
    cout<<"請輸入存款金額:";
    //將輸入的金額存入變數myAccount
    cin>>myAccount;
    //印出利率計算的結果
    cout<<"戶頭一利息:"<< myAccount*rate<<endl;

    return 0;
}

Share
Tweet
Share
No 意見
#include <iostream>
using namespace std;
int main()
{
    int x;
    int y;
  
    cout<<“Input two integers to get sum:”<<endl; 
    cin>>x>>y;
    cout<<“The sum of “<<x<<” and “<<y<<” is “<<x+y<<endl;
  
    return 0;
}
Share
Tweet
Share
1 意見
較新的文章
較舊的文章

FACEBOOK

歐維斯福利社

熱門文章

  • 【Windows 全攻略】各版本Windows ISO 下載
  • 【超狂】微軟各產品KMS序號大全!!!
  • 【電腦秘笈】如何下載YouTube的影片?只需兩個步驟!!!(不用安裝軟體)
  • 【c++範例】輸出、入變數的值
  • 最詳盡的CMD命令大全

標籤

C語言範例 C++ C++範例 駭客教學 電腦秘笈 Windows Windows高手秘笈 資安Q&A 病毒 C語言 程式設計 免費軟體 新鮮事 木馬程式 C語言病毒 Python SQL 檔案下載 硬體 Tor 序號大全 沙盒 測試樣本 登錄檔操作 GTA5 信息蒐集 外掛 底層 影音相關軟體 遊戲

開站以來瀏覽量

文章存檔

  • 7月 2019 (1)
  • 5月 2019 (1)
  • 12月 2018 (3)
  • 8月 2018 (2)
  • 7月 2018 (1)
  • 6月 2018 (1)
  • 4月 2018 (3)
  • 3月 2018 (4)
  • 2月 2018 (2)
  • 12月 2017 (2)
  • 11月 2017 (4)
  • 10月 2017 (3)
  • 9月 2017 (18)
  • 8月 2017 (28)
  • 7月 2017 (7)
  • 6月 2017 (3)
  • 5月 2017 (3)

歐維斯版權所有|未經許可禁止轉載