Console.WriteLine(¡°{0:c}¡±,j);//»õ±Ò¸ñʽÊä³ö
.......................................//»¹¿É°´¿ÆÑ§¼ÆÊý·¨¸ñʽ¡¢Í¨Óøñʽ¡¢×ÔÈ»Êý¾Ý¸ñʽÊä³ö
3. ʹÓÃConsoleÀàµÄReadLine·½·¨´Ó¿ØÖÆÌ¨½ÓÊÕÓû§µÄÊäÈ룬ȻºóÏÔʾ½ÓÊÕµÄÄÚÈÝ¡£³ÌÐòÈçÏ£º using System; class Test
{ static void Main( ) { string str;
Console.WriteLine(¡°ÇëÊäÈëÄãµÄÐÕÃû:¡±)£» str=Console.ReadLine( );
Console.WriteLine(¡°{0}£¬»¶ÓÄ㣡¡±£¬str)£» } }
³ÌÐòÔËÐнá¹û£º
4. ±àд³ÌÐò£¬Êä³öÒÔϱí´ïʽµÄÖµ sizeof(int)*10/3.2 8>6+3 5-2<3
6>2&&8>9
¡°Computer¡±==¡±Games¡± ¡°hello¡±+¡±world¡±
@¡±This is ¡°¡±a book¡±!=¡±This is \\¡±book¡±
3
5. Éè¼ÆÒ»¸ö³ÌÐò¸ù¾ÝÓû§ÊäÈëµÄ°ë¾¶£¬ÇóÔ²µÄÖܳ¤ºÍÃæ»ý¡£ÒªÇó¶¨ÒåPI³£Á¿Îª3.1415926¡£
using System;
using System.Collections.Generic; using System.Linq; using System.Text;
namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
double s,r;
double PI=3.1415926;
Console.WriteLine(\Çë?Êäo?Èë¡§?°ë??¾¶?\); r =double.Parse(Console.ReadLine()); s = r * PI * r ;
Console.WriteLine(\,s); } } }
4
6. ±àд³ÌÐòʵÏÖ´Ó¼üÅÌÊäÈëÁ½¸öÊý£¬Êä³öÆäÖеÄ×î´óÖµ¡££¨ÓÃÌõ¼þÔËËã·û£© using System;
using System.Collections.Generic; using System.Linq; using System.Text;
namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
double s,r,z;
Console.WriteLine(\ ±È½ÏÊý×Ö´óС£¬ÇëÊäÈëµÚÒ»¸öÊý×Ö£º°´»Ø³µ½áÊø\ r =double.Parse(Console.ReadLine());
Console.WriteLine(\ ±È½ÏÊý×Ö´óС£¬ÇëÊäÈëµÚ¶þ¸öÊý×Ö£º°´»Ø³µ½áÊø\ s = double.Parse(Console.ReadLine()); z = s > r ? s : r;
Console.WriteLine(\½á¹ûÏÔʾ,×î´óÊýΪ{0:n}\ } }
6£®³ÌÐòÔËÐнá¹û£º
using System;
using System.Collections.Generic; using System.Linq; using System.Text;
5
namespace ConsoleApplication2 {
class Program {
static void Main(string[] args) {
int a , b; a = b = 1; b += a / b++ ;
Console.Write(\,a,b); b += --a + ++b;
Console.WriteLine(\, a, b); Console.Read(); } } }
Èý¡¢ ˼¿¼Ì⣺
1£® ÔÚVisual Studio.NET´°¿ÚÖУ¬¿ÉÒԲ쿴µ±Ç°ÏîÄ¿µÄÀàºÍÀàÐ͵IJã´ÎÐÅÏ¢µÄ´°¿ÚÃû³ÆÊÇʲô£¿
2£® ConsoleÀàµÄReadLine·½·¨ºÍRead·½·¨ÓÐÊ²Ã´Çø±ð£¿ ConsoleÀàµÄWriteLineºÍWrite·½·¨
ÓÐÊ²Ã´Çø±ð£¿
6
Ïà¹ØÍÆ¼ö£º