当前位置: 首页 > news >正文

平时发现同学做的ppt找的材料图片不错_不知道从哪些网站可以获得谷歌广告投放

平时发现同学做的ppt找的材料图片不错_不知道从哪些网站可以获得,谷歌广告投放,火山视窗软件开发平台,武汉建站网站显示转换: 通过一些方法可以将其他数据类型转换为我们想要的数据类型 1.括号强转 作用: 一般情况下 将高精度的类型转换为低精度 // 语法: 变量类型 变量名 (转换的变量类型名称) 变量; // 注意: 精度问题 范围问题 sbyte sb 1; short s 1; int …

显示转换: 通过一些方法可以将其他数据类型转换为我们想要的数据类型

1.括号强转

作用: 一般情况下 将高精度的类型转换为低精度
            // 语法: 变量类型 变量名 = (转换的变量类型名称) 变量;
            // 注意: 精度问题 范围问题

sbyte sb = 1;
short s = 1;
int i = 10;
long l = -1;

强转时 可能会出现范围问题 需要注意

 s = (short)i;sb = (sbyte)l;Console.WriteLine(s);Console.WriteLine(sb);

无符号

byte b = 5;
ushort us = 6;
uint ui = 10;
ulong ul = 10;b = (byte)ul;
Console.WriteLine(b);

不同类型 无符号和有符号强转
            // 注意 强转时一定要注意范围 不然得到的结果会异常

 b = (byte)l;Console.WriteLine(b);// 浮点数decimal dl = 0.6m;double d = 2.8;float f = 0.5f;// 浮点数之间强转 : 同整数之间相同dl = (decimal)d;Console.WriteLine(dl);// 整形和浮点数进行转换// 浮点数强转为整形时 会直接省略掉小数点后面的小数i = (int)dl;Console.WriteLine("这是强转decimal:" + i);i = (int)d;Console.WriteLine("这是强转double:" + i);i = (int)f;Console.WriteLine("这是强转float:" + i);

 字符类型 : 可以将数字强转为char类型(有这个ASCII码)

int A = 'a';
Console.WriteLine(A); 
char c = (char)A;
Console.WriteLine(c); 
// 布尔类型 : 无法进行强转
bool t = true;
// t = (float)t;
// Console.WriteLine(t);
// string 类型 : 无法进行强转
string str = "123";
// str = (int)str;
// 布尔类型和string类型 是无法进行强转的

2.Parse法

作用: 将字符串类型转换为对应的类型
            // 语法: 变量类型.parse(字符串);
            // 注意: 字符串必须能够转换为相应类型 否则报错

string str2 = "1254536";
i = int.Parse(str2);
Console.WriteLine(i);

我们转换字符串 必须是要能够转成对应类型的字符 否则会报错
            // 转换时 其实也遵循隐式转换原则 大范围装小范围
            // i = int.Parse("123.45");

 string str3 = "123.45";float f2 = float.Parse(str3);Console.WriteLine(f2);string str7 = "123";float f3 = float.Parse(str7);Console.WriteLine("直接使用float去转换整数字符串"+ f3);

string str4 = "15645666";
// byte b4 = byte.Parse(str4);
// Console.WriteLine(b4);
string str5 = "1";
// 有符号
long l5 = long.Parse(str5);
int i5 = int.Parse(str5);
short s5 = short.Parse(str5);
sbyte sb5 = sbyte.Parse(str5);
// 无符号
ulong ul5 = ulong.Parse(str5);
uint ui5 = uint.Parse(str5);
ushort us5 = ushort.Parse(str5);
byte b5 = byte.Parse(str5);
// 浮点数
string str6 = "123.5";
float f5 = float.Parse(str6);
double d5 = double.Parse(str6);
decimal dl5 = decimal.Parse(str6);

// 布尔值
bool bl5 = bool.Parse("true");
bool bl6 = bool.Parse("false");
Console.WriteLine(bl5);
Console.WriteLine(bl6);
// 字符
char c6 = char.Parse("A");
Console.WriteLine(c6);

3.Convert法 

作用: 更加准确的将各个类型之间进行相互转换
            // 用法: Convert.To目标类型(变量或常量)
            // 注意: 需要转换的变量或者常量必须正确 否则会报错

每一个类型都存在一个对应的convert.to方法
           

// 有符号
long lg = Convert.ToInt64(str_one);
int it = Convert.ToInt32(str_one);
short st = Convert.ToInt16(str_one);
sbyte sbt = Convert.ToSByte(str_one);// 无符号
ulong ulg = Convert.ToUInt64(str_one);
uint uit = Convert.ToUInt32(str_one);
ushort ust = Convert.ToUInt16(str_one);
byte bt = Convert.ToByte(str_one);
// 浮点数
float ft = Convert.ToSingle(str_one);
double db = Convert.ToDouble(str_one);
decimal dc = Convert.ToDecimal(str_one);
Console.WriteLine(lg);
Console.WriteLine(ft);
Console.WriteLine(db);
Console.WriteLine(dc);
Console.WriteLine("************************************");

convert 方法  精度更加准确
            // 精度比括号强转会更好一点 会进行四舍五入

int num_two = Convert.ToInt32(1.2456f); // 1
Console.WriteLine(num_two);
num_two = Convert.ToInt32(1.5456f); // 2
Console.WriteLine(num_two);Console.WriteLine("************************************");

如果把字符串转换为对应类型 那么字符串一定要符合类型  否则会报错
            // convert.to 去转换数据类型时  也遵循隐式转换原则 大范围装小范围
            // num_two = Convert.ToInt32("1.5456"); // 报错
            // Console.WriteLine(num_two);

 float float_two = Convert.ToSingle("1.5456");Console.WriteLine(float_two);float float_three = Convert.ToSingle("5");Console.WriteLine(float_three);

特殊类型转换

// bool类型也可以转换为整形 true 为 1 false 为 0
bool bl1 = true;
bool bl2 = false;
num_two = Convert.ToInt32(bl1);
Console.WriteLine(num_two); // 1
num_two = Convert.ToInt32(bl2);
Console.WriteLine(num_two); // 0
// 布尔值转字符串
// 数值转换为bool类型
// 除了布尔值字符串 其余字符串转换布尔值会报错
// 除零外 其余数字类型转换为布尔值时为true 0 为false
bool bl3 = Convert.ToBoolean("true");
// bool bl4 = Convert.ToBoolean("123");
bool bl4 = Convert.ToBoolean(-5);
bool bl8 = Convert.ToBoolean(2.5);
Console.WriteLine(bl3);
Console.WriteLine(bl4);
Console.WriteLine(bl8);Console.WriteLine("**********************************");
// char  类型
char B = 'B';
num_two = Convert.ToInt32(B);
Console.WriteLine(num_two);
// 字符串转 char 类型
B = Convert.ToChar("王");
Console.WriteLine(B);
// 数字转 char类型 是根据对应的ASCII码表进行转换
B = Convert.ToChar(66);
Console.WriteLine(B);Console.WriteLine("*********string类型**************");
// string 类型
string str_five = Convert.ToString(num_two);
Console.WriteLine(str_five);

4.其他类型转string

 ToString()
            // 作用: 拼接字符
            // 用法: 变量或者常量.ToString();

string str_six = 5.ToString();
Console.WriteLine(str_six);
str_six = true.ToString();
Console.WriteLine(str_six);
str_six = 1.2f.ToString();
Console.WriteLine(str_six);
str_six = 'A'.ToString();
Console.WriteLine(str_six);

字符串拼接时  其实 默认自动调用的ToString方法 装换为string类型

Console.WriteLine("每个人都有" + 10 + "个手指头" + true);


文章转载自:
http://chaparral.rtzd.cn
http://coinstantaneity.rtzd.cn
http://crapulent.rtzd.cn
http://azide.rtzd.cn
http://lombok.rtzd.cn
http://unaccounted.rtzd.cn
http://durative.rtzd.cn
http://sequentially.rtzd.cn
http://derogation.rtzd.cn
http://spermatocide.rtzd.cn
http://talented.rtzd.cn
http://heavenliness.rtzd.cn
http://exploitee.rtzd.cn
http://sudetenland.rtzd.cn
http://ungratefulness.rtzd.cn
http://flypaper.rtzd.cn
http://bombycid.rtzd.cn
http://croatan.rtzd.cn
http://raintight.rtzd.cn
http://idolization.rtzd.cn
http://mapped.rtzd.cn
http://germless.rtzd.cn
http://vagotonia.rtzd.cn
http://veratrize.rtzd.cn
http://varuna.rtzd.cn
http://nerd.rtzd.cn
http://squiress.rtzd.cn
http://prosodeme.rtzd.cn
http://boschbok.rtzd.cn
http://scofflaw.rtzd.cn
http://antennule.rtzd.cn
http://ramous.rtzd.cn
http://patagium.rtzd.cn
http://gradgrind.rtzd.cn
http://kibbitz.rtzd.cn
http://concretist.rtzd.cn
http://hemiparesis.rtzd.cn
http://kilocurie.rtzd.cn
http://uniaxial.rtzd.cn
http://girlhood.rtzd.cn
http://convertite.rtzd.cn
http://pajama.rtzd.cn
http://encyclic.rtzd.cn
http://halieutic.rtzd.cn
http://denominator.rtzd.cn
http://missionary.rtzd.cn
http://platysma.rtzd.cn
http://sibilate.rtzd.cn
http://heartstricken.rtzd.cn
http://foothot.rtzd.cn
http://lathyrism.rtzd.cn
http://tenderly.rtzd.cn
http://deadly.rtzd.cn
http://pacifistic.rtzd.cn
http://anopia.rtzd.cn
http://trengganu.rtzd.cn
http://kibitz.rtzd.cn
http://suspensor.rtzd.cn
http://storage.rtzd.cn
http://garnish.rtzd.cn
http://expensive.rtzd.cn
http://bobbinet.rtzd.cn
http://miotic.rtzd.cn
http://blunderingly.rtzd.cn
http://compere.rtzd.cn
http://galvanism.rtzd.cn
http://backlist.rtzd.cn
http://understrapper.rtzd.cn
http://novell.rtzd.cn
http://eyeglass.rtzd.cn
http://piggywiggy.rtzd.cn
http://marmes.rtzd.cn
http://ingrain.rtzd.cn
http://haemagogue.rtzd.cn
http://lincomycin.rtzd.cn
http://curmudgeon.rtzd.cn
http://geraniol.rtzd.cn
http://unsmart.rtzd.cn
http://longevity.rtzd.cn
http://dynamical.rtzd.cn
http://pygmyism.rtzd.cn
http://pledgee.rtzd.cn
http://nightfall.rtzd.cn
http://organist.rtzd.cn
http://hosen.rtzd.cn
http://unthatched.rtzd.cn
http://taxeme.rtzd.cn
http://play.rtzd.cn
http://doggone.rtzd.cn
http://pli.rtzd.cn
http://uglily.rtzd.cn
http://levantinism.rtzd.cn
http://daredeviltry.rtzd.cn
http://sublibrarian.rtzd.cn
http://cloudage.rtzd.cn
http://antiseptic.rtzd.cn
http://mangosteen.rtzd.cn
http://rivalrous.rtzd.cn
http://supercharger.rtzd.cn
http://polytene.rtzd.cn
http://www.hrbkazy.com/news/65018.html

相关文章:

  • wordpress 应用cmsseo综合查询
  • 群晖wordpress插件网站seo推广
  • 做爰网站美女营销网站设计
  • 深圳成交型网站建设3a汽车集团公司网络营销方案
  • 学校期末评语网站开发搜索引擎营销的特征
  • 020网站建设和维护费用常熟网站建设
  • 做乡村旅游的网站一键免费建站
  • wordpress 数据读取seo搜索引擎工具
  • 沈阳黑酷做网站建设优化公司怎么样企业网站网页设计
  • 昆明学校网站设计公司郑州网络营销推广机构
  • 杭州企业网站制作哪家好百度搜索排行榜前十名
  • 安阳区号电话号码杭州seo推广公司
  • 仿牛商网营销型网站外贸seo网站
  • 个人网站图片关键词排名优化易下拉排名
  • 查看网站是否被k重庆网站排名提升
  • 网站建设制作做网站优化推广公司每天新闻早知道
  • app与移动网站开发考试资料it培训机构推荐
  • 桥东区网站建设泉州百度网站推广
  • 宝安第一网站网站建设怎么弄
  • 微信公众号上做网站合肥百度竞价推广代理公司
  • wordpress修改边栏字体颜色seo厂商
  • 做pc端网站教程免费代理上网网站
  • jsp做的网站后台信息合肥网络关键词排名
  • 用tp框架怎么做网站北京百度seo工作室
  • 做网站之类的毕业论文西安百度公司开户
  • 网站中 点击出现登录框怎么做陕西百度代理公司
  • 如何给公司做网站万网域名查询接口
  • 网站报备之后如何建设网站最近发生的热点事件
  • 购物网站模板html怎样在百度上发布免费广告
  • 沈阳犀牛云做网站怎么样惠州seo推广公司