herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
XOR prefixsum CPP python解Leetcode 1829 Maximum XOR for Each Query 其實這裡考慮的是元素個數為2^maximumBit的交換群,運算子為XOR。 [Python code請進]
-
你會用C的算子sizeof?
-
Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence C++ & Python都有字串的find,用法都類似 split=s.find(' ', split+1)能找到s從index=split+1開...
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
Colab上安裝中文字型修改股市爬蟲pyplot顯圖 使用python套件: numpy, requests. pyplot, matplotlib.font_manager, matplotlib.mpl
-
2 pointer Python C++解Leetcode 3163 String Compression III [codes on Leetcode] https://leetcode.com/problems/string-compression-iii/solution...
71 則留言:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
{
Console.WriteLine(x[0]);
}
else if (bmi < 24)
{
Console.WriteLine(x[1]);
}
else if (bmi < 27)
{
Console.WriteLine(x[2]);
}
else
{
Console.WriteLine(x[3]);
}
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
{
Console.WriteLine(x[0]);
}
else if (bmi < 24)
{
Console.WriteLine(x[1]);
}
else if (bmi < 27)
{
Console.WriteLine(x[2]);
}
else
{
Console.WriteLine(x[3]);
}
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi<24)
Console.WriteLine(x[1]);
else if(bmi<27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bmi_is_ease
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi{0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else
Console.WriteLine("還早");
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bmi_is_ease
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi{0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else
Console.WriteLine("還早");
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bmi_is_ease
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi{0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else
Console.WriteLine("還早");
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bmi_is_ease
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi{0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else
Console.WriteLine("還早");
Console.Read();
}
}
}
namespace _0325
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h*h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else
Console.WriteLine("??");
Console.Read();
}
}
}
namespace BMI
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi<24)
Console.WriteLine(x[1]);
else if (bmi<27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;//命名空間
namespace _2202020//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;//命名空間
namespace project02//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute Bmi\n");//宣告變數
double h = 172, w = 75, bmi;
string tmp;
Console.Write("h=");
tmp = Console.ReadLine(); //讀資訊
h= Convert.ToDouble(tmp); //轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine(); //讀資訊
w = Convert.ToDouble(tmp); //轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x ={ "過輕","正常","過重","肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
namespace _0325
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;//命名空間
namespace project02//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute Bmi\n");//宣告變數
double h = 172, w = 75, bmi;
string tmp;
Console.Write("h=");
tmp = Console.ReadLine(); //讀資訊
h= Convert.ToDouble(tmp); //轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine(); //讀資訊
w = Convert.ToDouble(tmp); //轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x ={ "過輕","正常","過重","肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;//命名空間
namespace _2202020//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute Bmi\n");
double h = 150, w = 50, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
namespace BMI
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi<24)
Console.WriteLine(x[1]);
else if (bmi<27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;//命名空間
namespace project02//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute Bmi\n");//宣告變數
double h = 172, w = 75, bmi;
string tmp;
Console.Write("h=");
tmp = Console.ReadLine(); //讀資訊
h= Convert.ToDouble(tmp); //轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine(); //讀資訊
w = Convert.ToDouble(tmp); //轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x ={ "過輕","正常","過重","肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(h);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕","正常","過重","肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(h);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕","正常","過重","肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;//命名空間
namespace project02//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
double h, w, bmi;
string tmp;
Console.Write("h=");
tmp = Console.ReadLine(); //讀資訊
h= Convert.ToDouble(tmp); //轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine(); //讀資訊
w = Convert.ToDouble(tmp); //轉型態
Console.WriteLine(w);
bmi =10000* w / (h * h);
Console.WriteLine("輸入的bmi={0}" , bmi);//輸出結果
string[] x = {"過輕要吃多一點喔","正常很棒","過重要控制囉","肥胖要開始運動囉太誇張囉"};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
namespace _2202020//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi{0}",bmi);//輸出結果
string[] x = { "過輕","正常","過重","肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {"過輕喔~可以多吃一點","正常~繼續維持喔","過重~需要控制一下體重","肥胖~該減肥囉~" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi <27 )
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi<24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
using System;
namespace ConsoleApp4
{
class Program
{
static void Main(string[] args)
{
int h = 178;
int w = 79;
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToInt32(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToInt32(tmp);
Console.WriteLine("w=" + w);
double bmi = 10000.0 * w / h / h;
Console.WriteLine("輸入的bmi=(0)" + bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
{
Console.WriteLine(x[0]);
}
else if (bmi < 24)
{
Console.WriteLine(x[1]);
}
else if (bmi < 27)
{
Console.WriteLine(x[2]);
}
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
namespace bmi
{
class Program
{
static void Main(string[] args)
{
int m = 165;
int w = 60;
string temp;
Console.WriteLine("m=");
temp = Console.ReadLine();
m = Convert.ToInt32(temp);
Console.WriteLine("m=" + m);
Console.WriteLine("w=");
temp = Console.ReadLine();
w = Convert.ToInt32(temp);
Console.WriteLine("w=" + w);
double bmi = 10000.0 * w / m / m;
Console.WriteLine("bmi="+bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
{
Console.WriteLine(x[0]);
}
else if (bmi < 24)
{
Console.WriteLine(x[1]);
}
else if (bmi < 27)
{
Console.WriteLine(x[2]);
}
else
{
Console.WriteLine(x[3]);
}
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕,請再多吃一點,你看你走在路上都快被風吹走了,比小鳥還輕啊你!",
"適中,唉唷,不錯喔~繼續保持,輝常好!",
"過重,欸靠啦,賈修接啦,吃太多了好嗎,控制一下欸",
"肥胖,...大哥/姐,身體愛顧,健康無窮" };
if (bmi < 18.5)
{
Console.WriteLine(x[0]);
}
else if (bmi < 24)
{
Console.WriteLine(x[1]);
}
else if (bmi < 27)
{
Console.WriteLine(x[2]);
}
else
{
Console.WriteLine(x[3]);
}
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {//字串陣列
"過輕",//X[0]
"正常",//X[1]
"過重",//X[2]
"肥胖"//X[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi<24)
Console.WriteLine(x[1]);
else if(bmi<27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi/n");
double h = 160, w = 57, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi>24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
String tmp;
Console.Write("BMI開始計算\r\n");
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {//字串陣列
"過輕",//x[0]
"正常",//x[1]
"過重",//x[2]
"肥胖" //x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else if (bmi >= 27)
Console.WriteLine(x[3]);
Console.Read();
}
}
}
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi<24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {"過輕","正常","過重","肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi <27 )
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bmi_is_ease
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi{0}", bmi);
string[] x = { "過輕-吃撐一點快餓死了", "正常-標準範圍", "過重-別吃了", "肥胖-吃到越來越像豬了" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi< 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;//命名空間
namespace project02//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute Bmi\n");//宣告變數
double h = 172, w = 75, bmi;
string tmp;
Console.Write("h=");
tmp = Console.ReadLine(); //讀資訊
h= Convert.ToDouble(tmp); //轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine(); //讀資訊
w = Convert.ToDouble(tmp); //轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x ={ "太輕了","你很正常","有點重","肥胖!!" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)//主程式
{
double h, w, bmi;
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble (tmp);
Console.WriteLine(w);
bmi = 10000.0 * w /(h*h);
Console.WriteLine("輸入的 bmi={0}" , bmi);
string[] x = { "你是毛聖翔嗎?還過輕", "這樣是正常身材", "你好像有點超過了", "你是毛聖翔嗎?肥胖!" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi<24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;//命名空間
namespace project02//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
double h, w, bmi;
string tmp;
Console.Write("h=");
tmp = Console.ReadLine(); //讀資訊
h= Convert.ToDouble(tmp); //轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine(); //讀資訊
w = Convert.ToDouble(tmp); //轉型態
Console.WriteLine(w);
bmi =10000* w / (h * h);
Console.WriteLine("輸入的bmi={0}" , bmi);//輸出結果
string[] x = {"你太輕了","你很正常","有點重囉","太肥囉要運動"};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
namespace ConsoleApp2
{
internal class Program
{
private static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = {//字串陣列
"你好輕喔:D",//x[0]
"正常:)",//x[1]
"胖了,注意一下",//x[2]
"太胖減肥好嗎"//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
int m = 165;
int w = 50;
string temp;
Console.WriteLine("m=");
temp = Console.ReadLine();
m = Convert.ToInt32(temp);
Console.WriteLine("m=" + m);
Console.WriteLine("w=");
temp = Console.ReadLine();
w = Convert.ToInt32(temp);
Console.WriteLine("w=" + w);
double bmi = 10000.0 * w / m / m;
Console.WriteLine("bmi=" + bmi);
string[] x = {//字串陣列
"過輕",//x[0]
"適中",//x[1]
"過重",//x[2]
"肥胖",//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
namespace bmi
{
class Program
{
static void Main(string[] args)
{
int m = 165;
int w = 60;
string temp;
Console.WriteLine("m=");
temp = Console.ReadLine();
m = Convert.ToInt32(temp);
Console.WriteLine("m=" + m);
Console.WriteLine("w=");
temp = Console.ReadLine();
w = Convert.ToInt32(temp);
Console.WriteLine("w=" + w);
double bmi = 10000.0 * w / m / m;
Console.WriteLine("bmi="+bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
{
Console.WriteLine(x[0]);
}
else if (bmi < 24)
{
Console.WriteLine(x[1]);
}
else if (bmi < 27)
{
Console.WriteLine(x[2]);
}
else
{
Console.WriteLine(x[3]);
}
Console.Read();
}
}
}
using System;
namespace ConsoleApp2
{
internal class Program
{
private static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = {//字串陣列
"你好輕喔:D",//x[0]
"正常:)",//x[1]
"胖了,注意一下",//x[2]
"太胖減肥好嗎"//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { //字串陣列
"是要不要吃飯?",//x[0]
"你好棒",//x[1]
"不要吃了!",//x[2]
"媽的胖子"//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的.bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
{
Console.WriteLine(x[0]);
}
else if (bmi < 24)
{
Console.WriteLine(x[1]);
}
else if (bmi < 27)
{
Console.WriteLine(x[2]);
}
else
{
Console.WriteLine(x[3]);
}
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
h = h / 100;
bmi = w / (h * h);
Console.WriteLine("bmi=" + bmi);//輸出結果
Console.Read();
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi=(0)", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi > 24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
h = h / 100;
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {//字串
"過輕",//x[0]
"正常",//x[1]
"過重",//x[2]
"肥胖",//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
h = h / 100;
bmi = w / (h * h);
Console.WriteLine("bmi=" + bmi);//輸出結果
Console.Read();
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi=(0)", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi > 24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
h = h / 100;
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {//字串
"太輕ㄌ吃多點",//x[0]
"理想",//x[1]
"有點重哦小心點",//x[2]
"太胖ㄌ!!",//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace test0325
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {
"你太輕了",
"在正常範圍內",
"你過重了",
"肥胖!面對現實吧!你需要減肥了!"
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace T0325
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi =10000* w / (h * h);
Console.WriteLine("輸入的 bmi={0}" , bmi);
string[] x = {//字串
"過輕拉ˊˇˋ",//x[0]
"正常讚歐ouo",//x[1]
"過重惹,加油歐ˋouoˊ",//x[2]
"肥胖QHQ活得快樂就好QQ"//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
h = h / 100;
bmi = w / (h * h);
Console.WriteLine("bmi=" + bmi);//輸出結果
Console.Read();
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi=(0)", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi > 24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _2020._03._25
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {//字串陣列
"過輕!!太輕了啦,多吃點",//x[0]
"正常~很棒!繼續維持啊!",//x[1]
"過重!!哦!要注意了哦!",//x[2]
"肥胖!!!欸欸欸欸要減肥了!!!這樣馥甄會嫌棄你"//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
h = h / 100;
bmi = w / (h * h);
Console.WriteLine("bmi=" + bmi);//輸出結果
Console.Read();
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi=(0)", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi > 24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
h = h / 100;
bmi = w / (h * h);
Console.WriteLine("bmi=" + bmi);//輸出結果
Console.Read();
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi=(0)", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi > 24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute BMI\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };//字串陣列
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 25)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
h = h / 100;
bmi = w / (h * h);
Console.WriteLine("bmi=" + bmi);//輸出結果
Console.Read();
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi=(0)", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi > 24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
h = h / 100;
bmi = w / (h * h);
Console.WriteLine("bmi=" + bmi);//輸出結果
Console.Read();
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi=(0)", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi > 24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute BMI\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };//字串陣列
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 25)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("compute Bmi\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
w = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
h = h / 100;
bmi = w / (h * h);
Console.WriteLine("bmi=" + bmi);//輸出結果
Console.Read();
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi=(0)", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi > 24)
Console.WriteLine(x[1]);
else if (bmi > 27)
Console.WriteLine(x[3]);
Console.Read();
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = {//字串陣列
"需要多運動,均衡飲食,以增加體能,維持健康!",//x[0]
"恭喜!健康體重,要繼續保持!",//x[1]
"哦!體重過胖了,要小心囉,趕快身體力行健康管理!",//x[2]
"肥胖啊~肥胖,需要立刻力行健康體重管理囉!"//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = {//字串陣列
"需要多運動,均衡飲食,以增加體能,維持健康!",//x[0]
"恭喜!健康體重,要繼續保持!",//x[1]
"哦!體重過胖了,要小心囉,趕快身體力行健康管理!",//x[2]
"肥胖啊~肥胖,需要立刻力行健康體重管理囉!"//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w= Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {
"需要多運動,均衡飲食,以增加體能,維持健康!",//x[0]
"恭喜!「健康體重」,要繼續保持!",//x[1]
"哦!體重過胖了,要小心喔,趕快力行「健康體重管理」!",//x[2]
"肥胖阿~肥胖,需要立刻力行「健康體重管理」囉!"//x[3]
};
if (bmi<18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}",bmi);
string[] x = { //字串陣列
"需要多運動,均衡飲食,以增加體能,維持健康!",//x[0]
"恭喜!「健康體重」,要繼續保持!",//x[1]
"哦!「體重過重」了,要小心囉,趕快力行「健康體重管理」!",//x[2]
"肥胖阿~「肥胖」,需要立刻力行「健康體重管理」囉!"//x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
namespace BMI
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi<24)
Console.WriteLine(x[1]);
else if (bmi<27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
namespace BMI
{
class Program
{
static void Main(string[] args)
{
string tmp;
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = { "過輕", "適中", "過重", "肥胖" };
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi<24)
Console.WriteLine(x[1]);
else if (bmi<27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute BMI\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };//字串陣列
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 25)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute BMI\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };//字串陣列
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 25)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
String tmp;
Console.Write("BMI開始計算\r\n");
double h, w, bmi,i;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {//字串陣列
"過輕",//x[0]
"正常",//x[1]
"過重",//x[2]
"肥胖" //x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
String tmp;
Console.Write("BMI開始計算\r\n");
double h, w, bmi;
Console.Write("h=");
tmp = Console.ReadLine();
h = Convert.ToDouble(tmp);
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();
w = Convert.ToDouble(tmp);
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的 bmi={0}", bmi);
string[] x = {//字串陣列
"過輕",//x[0]
"正常",//x[1]
"過重",//x[2]
"肥胖" //x[3]
};
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if(bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 27)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1//命名空間
{
class Program//類別
{
static void Main(string[] args)//主程式
{
Console.Write("compute BMI\n");
double h = 185, w = 90, bmi;//宣告變數
string tmp;
Console.Write("h=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(h);
Console.Write("w=");
tmp = Console.ReadLine();//轉資訊
h = Convert.ToDouble(tmp);//轉型態
Console.WriteLine(w);
bmi = 10000 * w / (h * h);
Console.WriteLine("輸入的bmi={0}", bmi);
string[] x = { "過輕", "正常", "過重", "肥胖" };//字串陣列
if (bmi < 18.5)
Console.WriteLine(x[0]);
else if (bmi < 24)
Console.WriteLine(x[1]);
else if (bmi < 25)
Console.WriteLine(x[2]);
else
Console.WriteLine(x[3]);
Console.Read();
}
}
}
使用System; //命名空間
namespace project02 //命名空間
{
class Program //類別
{
static void Main(string [] args)//主程序
{
double h,w,bmi;
字符串tmp;
Console.Write(“ h =”);
tmp = Console.ReadLine(); //讀資訊
h = Convert.ToDouble(tmp); //過渡態
Console.WriteLine(h);
Console.Write(“ w =”);
tmp = Console.ReadLine(); //讀資訊
w = Convert.ToDouble(tmp); //過渡態
Console.WriteLine(w);
bmi = 10000 * w /(h * h);
Console.WriteLine(“輸入的bmi = {0}”,bmi); //輸出結果
string [] x = {“過輕要吃多一點喔”,“正常很棒”,“過重要控制囉”, “肥胖要開始運動囉太誇張囉”};
如果(bmi <18.5)
Console.WriteLine(x [0]);
Console.WriteLine(x [1]);
否則(bmi <27)
Console.WriteLine(x [2]);
其他
Console.WriteLine(x [3]);
Console.Read();
}
namespace project02 //命名空間
{
類Program //類別
{
static void Main(字符串[] args)//主程序
{
double h,w,bmi;
字符串tmp;
Console.Write(“ h =”);
tmp = Console.ReadLine(); //讀資訊
h = Convert.ToDouble(tmp); //過渡態
Console.WriteLine(h);
Console.Write(“ w =”);
tmp = Console.ReadLine(); //讀資訊
w = Convert.ToDouble(tmp); //過渡態
Console.WriteLine(w);
bmi = 10000 * w /(h * h);
Console.WriteLine(“輸入的bmi = {0}”,bmi);//輸出結果
string [] x = {“過輕要吃多一點喔”,“正常很棒”,“過重要控制囉”,“肥胖要開始運動囉太誇張囉”};
如果(bmi <18.5 )
Console.WriteLine(x [0]);
Console.WriteLine(x [1]);
否則(bmi <27)
Console.WriteLine(x [2]);
其他
Console.WriteLine(x [3]);
Console.Read();
}
張貼留言