请回答一个问题,预祝你升☆☆☆

wuyi8808 2009-01-22 08:09:45
class Demo
{
static void Main()
{
Console.WriteLine("☆☆☆");
}
}
/*
Microsoft (R) Visual C# 2005 编译器 版本 8.00.50727.1433
用于 Microsoft (R) Windows (R) 2005 Framework 版本 2.0.50727
版权所有 (C) Microsoft Corporation 2001-2005。保留所有权利。

Demo.cs(5,5): error CS0103: 当前上下文中不存在名称“Console”
*/


上面的程序不能通过编译。
请在上面的程序中添加不超过20个字符,使它能通过编译并且输出:☆☆☆。
要求:添加的字符中不能含有 . 和 ; 这两个字符。
...全文
469 80 打赏 收藏 转发到动态 举报
写回复
用AI写文章
80 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuyi8808 2009-02-02
  • 打赏
  • 举报
回复
namespace Demo.System
{
struct Int32{} // 即使去掉此行,下面的 System.Int32 的含义和 int 仍然不一样。

class Program
{
static void Main()
{
System.Int32 i; // 此处 System.Int32 的含义和 int 不一样。
global::System.Console.WriteLine(i);

}
}
}
winner2050 2009-01-26
  • 打赏
  • 举报
回复
[Quote=引用 78 楼 wuyi8808 的回复:]
引用 77 楼 qiqundelang 的回复:
路过...不打扰winner2050接分...


但是,。。。。。。。。,似乎,。。。。。。,winner2050 没有接分的意愿。

明天晚上结帐,视回答问题的情况散掉。
[/Quote]

过年忙啊。
wuyi8808 2009-01-23
  • 打赏
  • 举报
回复
[Quote=引用 62 楼 winner2050 的回复:]
别闹我啦。

现在要打扫卫生,我忙啊。

还要到处翻贴来JF。
[/Quote]

你不给个说得过去的回答,我怎么倒分给你?
wuyi8808 2009-01-23
  • 打赏
  • 举报
回复
[Quote=引用 60 楼 o____ 的回复:]
还有楼主,这回怎么不推荐一个了?
[/Quote]

这回就麻烦你推荐一下好了,或者麻烦你帮我找个斑竹推荐一下,THX。
winner2050 2009-01-23
  • 打赏
  • 举报
回复
别闹我啦。

现在要打扫卫生,我忙啊。

还要到处翻贴来JF。
wuyi8808 2009-01-23
  • 打赏
  • 举报
回复
[Quote=引用 57 楼 lianhui1122 的回复:]
看楼主的技术分和排名,不像是不知道的。。
[/Quote]

拜托,不是我不知道,而是要找个借口倒分给 winner2050
o____ 2009-01-23
  • 打赏
  • 举报
回复
还有楼主,这回怎么不推荐一个了?
o____ 2009-01-23
  • 打赏
  • 举报
回复

倒分就没意思了

这个winner2050就知道成天吹大炮,也没怎么见过他能解决实际问题的,以前他也承认过他两星是倒来的,现在倒三星了,很好,很13


wuyi8808 2009-01-23
  • 打赏
  • 举报
回复
[Quote=引用 57 楼 lianhui1122 的回复:]
看楼主的技术分和排名,不像是不知道的。。
class Demo
{
static void Main()
{
System.Console.WriteLine("☆☆☆");
}
}
[/Quote]

[Quote=引用楼主 wuyi8808 的帖子:]
要求:添加的字符中不能含有 . 和 ; 这两个字符。
[/Quote]

楼上的老大,添加的字符中不能含有 . 啊。

况且1楼已经回复过了,难道你没看到?
finelei2007 2009-01-23
  • 打赏
  • 举报
回复
有没有systemVerilog语言的例子下载?
finelei2007 2009-01-23
  • 打赏
  • 举报
回复
有没有systemVerilog语言的例子下载?
finelei2007 2009-01-23
  • 打赏
  • 举报
回复
有没有systemVerilog语言的例子下载?
lianhui1122 2009-01-23
  • 打赏
  • 举报
回复
看楼主的技术分和排名,不像是不知道的。。
class Demo
{
static void Main()
{
System.Console.WriteLine("☆☆☆");
}
}
much0726 2009-01-23
  • 打赏
  • 举报
回复
挺边缘的知识,对我来说.
C_sdnElf 2009-01-23
  • 打赏
  • 举报
回复
学习!UP
liumeiqinyang 2009-01-23
  • 打赏
  • 举报
回复
春节csdn怎么没有说发红包呢
wuyi8808 2009-01-23
  • 打赏
  • 举报
回复
在 C# 中,int 是 System.Int32 的别名,大多数情况下可以互换使用。
但也有以下几点不一样的地方:

1、int 可以作为枚举的基类型,System.Int32 不可以。
2、在字符串中是不一样的,"int" 明显不等于 "System.Int32"。
3、Type.GetType("int") 和 Type.GetType("System.Int32") 不一样。
4、int 是关键字,而 System.Int32 不是,所以在 @ 后面的表现不一样。

除了以上几点外,请问 winner2050,int 和 System.Int32 在什么情况下还有不同?
qinhl99 2009-01-23
  • 打赏
  • 举报
回复
mark
wuyi8808 2009-01-23
  • 打赏
  • 举报
回复
// 另外,int 是 C# 的关键字,而 System.Int32 不是,所以在 @ 后面的表现不一样。

class Program
{
static void Main()
{
@System.Int32 i = 5; // 没问题
@int j = 5; // error CS0246: 找不到类型或命名空间名称“int”
}
}
wuyi8808 2009-01-23
  • 打赏
  • 举报
回复
using System;

class Program
{
static void Main()
{
// typeof(int) 和 typeof(System.Int32) 是一样的,都是 System.Int32。
Console.WriteLine(typeof(int)); // 输出: System.Int32
Console.WriteLine(typeof(System.Int32)); // 输出: System.Int32
Console.WriteLine(typeof(int) == typeof(System.Int32)); // 输出: True

// 但 Type.GetType("int") 和 Type.GetType("System.Int32") 不一样,
// 前者为 null,后者是 System.Int32。
Console.WriteLine(Type.GetType("int")); // 输出: 空
Console.WriteLine(Type.GetType("System.Int32")); // 输出: System.Int32
Console.WriteLine(Type.GetType("int") == Type.GetType("System.Int32")); // 输出: False

Console.WriteLine(typeof(int) == Type.GetType("System.Int32")); // 输出: True
Console.WriteLine(typeof(int) == Type.GetType("int")); // 输出: False
}
}
加载更多回复(60)

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧