using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace 特殊运算符
{
class Program
{
static void Main(string[] args)
{
int hi = 451;
bool zi = false;
bool result;
result = (zi) | (hi > 400);
string yesno= result ? 是:不是;
Console.WriteLine("{0}",yesno);
Console.ReadLine();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace 特殊运算符
{
class Program
{
static void Main(string[] args)
{
int hi = 451;
bool zi = false;
bool result;
result = (zi) | (hi > 400);
string yesno= result ? 是:不是;
Console.WriteLine("{0}",yesno);
Console.ReadLine();
}
}
}
解决方案 »
- 哪位好心的朋友,把我写的发送字符串的socket程序,改写成 发送一个很长的二进制数字的程序?基本结构不变
- *********怎么实现把SQLSERVER数据库数据导出到excel***********
- js 文件在aspx 页面里面怎么不能显示????
- 为什么C#不能这么写(无知抱怨贴)
- !!!请教高手 在c#中怎样测试打印机在网络中是否连接或可用!!!
- 如何用c#做一个ping 的软件呢!
- 出入库+销售 的数据库设计!!!
- 关于winform程序自己引用的网站的禁止弹窗
- 上次看caozhy写了个linq的资源管理器,好屌。
- Windows Form下,datagrid如何实现分页?
- c# 怎样断开一个已连接用户?
- 求高手结疑问
bool zi = false;
bool result;
result = (zi) | (hi > 400); // 或运算符 左假右真 最后结果为真 即 result=true
string yesno= result ? "是":"不是";
Console.WriteLine("{0}",yesno);
错误 2 当前上下文中不存在名称“不是” G:\编程\特殊运算符\特殊运算符\Program.cs 21 38 特殊运算符 求高手解决一下!本人不胜感激!
要用引号:
string yesno= result ? "是":"不是";
应该改成
result = (zi) || (hi > 400);
改成这样啦!string yesno= result ? 是:不是;
要用引号:
string yesno= result ? "是":"不是";