# C++ ## 輸入華氏求攝氏 ```cpp= #include <iostream> using namespace std; int main() { double c,f; cout<<"華氏?"; cin>>f; c=(f-32)*5/9; cout<<"攝氏溫度為"<<c<<endl; } ``` ## 今年幾歲(課本1-23) ```cpp= #include <iostream> using namespace std; int main() { int years; cout<<"幾歲?"<<endl; cin>>years; cout<<"我今年"<<years<<"歲"<<endl; } ``` ## a+b=c ```cpp= #include <iostream> using namespace std; int main() { float a,b,c; cout<<"pyosik is best jungler"<<endl; cin>>a>>b; c=a+b; cout<<c; } ``` ## 輸入攝氏求華氏(課本2-18) ```cpp= #include <iostream> using namespace std; int main() { double c,f; cout<<"攝氏?"; cin>>c; f=c*9/5+32; cout<<"華氏溫度為"<<f<<endl; } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up