herrDeng網內搜尋

自訂搜尋

Ads

2020年3月25日 星期三

ex5 將bmi加上if else



BMI<18.5 為過輕,
18.5≦BMI<24 為正常體重,
24≦BMI<27 為過重,
BMI≧27 即為肥胖

71 則留言:

A10833002 提到...

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();
}
}
}

A10833002 提到...

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();
}
}
}

B10833028蔡晏程 提到...

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();
}
}
}

b10833084 提到...

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();

b10833020 提到...

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();

b10833070 提到...

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();

b10833021 提到...

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();
}
}
}

B10833024 王翔緯 提到...

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();
}
}
}

b10833002田昌弘 提到...

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();
}
}
}

B10833037 提到...

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();





}
}
}

B10833010 戴俊瑋 提到...

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();
}
}
}

B10833046王子榮 提到...

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();
}
}
}

B10833024 王翔緯 提到...

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();
}
}
}

B10833046王子榮 提到...

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();
}
}
}

B10833011 彭丙玉 提到...

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();
}
}
}

B10833037 提到...

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();





}
}
}

B10833045施明睿 提到...

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();
}
}
}

b10833006朱軒廣 提到...

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();
}
}
}

b10833042謝孟修 提到...

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();
}
}
}

B10833029 余柏翰 提到...

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();
}
}
}

B10833047馮群赫 提到...

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();
}
}
}

B10833072 提到...

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();
}
}
}

b10833027呂沂真 提到...

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();
}
}
}

B10833114 鍾杰廷 提到...

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();
}
}
}

B10815089潘宥丞 提到...

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();

b10833033蔡孟頻 提到...

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();
}
}
}

b10833023 陳姿茹 提到...

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();


}
}
}

A10833002 提到...

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();
}
}
}

B10833028蔡晏程 提到...

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();
}
}
}

B10833083 夏湘琳 提到...

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();

B10833022 許家銘 提到...

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();
}
}
}

B10815106林子豪 提到...

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();

B10833007 林文瑋 提到...

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();
}
}
}

b10833021 提到...

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();
}
}
}

B10833073毛聖翔 提到...

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();
}
}
}

b10833004黃薰田 提到...

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();


}
}
}

B10815038温政祥 提到...

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();


}
}
}

B10833043彭律惠 提到...

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();
}
}
}

b10833023 陳姿茹 提到...

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();


}
}
}

B10833026鄭亞易 提到...

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();


}
}
}

B10833050張少豪 提到...

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();
}
}
}

B10833030吳璟辰 提到...

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();
}
}
}

B10833041 黃柏凱 提到...

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();

b10833069 鍾秉哲 提到...

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();
}
}
}

B10833041 黃柏凱 提到...

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();

B10833096 林建鈞 提到...

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();
}
}
}

B10833034 彭仲麟 提到...

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();
}
}
}

B10833001宋映嫺 提到...

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();
}
}
}

B10833009 張恩齊 提到...

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();

B10833082 黃鈺淇 提到...

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();

B10833148 提到...

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();

b10833038 陳冠傑 提到...

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();

B10833040徐嘉駿 提到...

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();





}
}
}

B10833044 范光祐 提到...

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();

B10815036 李宥陞 提到...

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();

B10813140邱東建 提到...

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();

b10833016 余竺瑾 提到...

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();

D10811007蘇鈺貽 提到...

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();
}
}
}

B10811012何郁麒 提到...

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();
}
}
}

A10833001林承君 提到...


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();
}


}
}

A10833004許惠玟 提到...

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();
}
}
}

B10833031 提到...

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();





}
}
}

B10833014 提到...

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();





}
}
}

B10813140邱東建 提到...

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();

B10813140 提到...

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();

B10833022 許家銘 提到...

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();
}
}
}

B10833022 許家銘 提到...

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();
}
}
}

b10833025徐郁堂 提到...

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();





}
}
}

B10833018 杜立笙 提到...

使用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();
}

B10813027唐一渝 提到...

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();
}

Related Posts Plugin for WordPress, Blogger...

熱門文章