Home > Net >  C # output input statement
C # output input statement

Time:10-04

Output: the Console. The Write ();
The output as follows several
{
//direct output string
The Console. Write (" bear ");
//start from 0 position, can add
The Console. Write (" {0} ", bear);
//variable output
String name="bear";
The Console. Write (name);
}

Input: the Console. ReadLine (); Receives the value is the string types of
Input values receive as follows several {
//string directly receive
String name=Console. ReadLine ();
//int integer type to type int receive income string can be converted to
Int the age=int. Parse (Console. ReedLine ());
//with it in the same way...
A double score=double. Parse (Console. ReedLine ());
//not introduce one by one
}

The point!
When you put an int value and is a string value addition will appear below the case {
Int the age=5;
String name="10";
The Console. Write (age + name);
The Console. ReadLine ();
//c # speed faster
After the output and input can be seen in front of the output content
}
In the above procedure would result in a "510";
If two are int type will be added;

What I don't know can contact me
C # js Java HTML
I will teach you more by language updated daily

CodePudding user response:

The Console. Write (" {0} "and" bear "); Write the wrong I'm sorry

CodePudding user response:

Severe admire!!

CodePudding user response:

https://docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/

CodePudding user response:

Write not line, can increase the \ r \ n
WriteLine a newline

CodePudding user response:

The
references 4 floor XBodhi. Response:
Write not line, can increase the \ r \ n
WriteLine line breaks
forget to supplement for the first time to write

CodePudding user response:

Suggest writing a blog

CodePudding user response:

Cattle group

CodePudding user response:

refer to 6th floor Liu Cai ghost reply:
advice blog
write blog where I want to experience

CodePudding user response:

Blog. CSDN. Cn/your user name
  •  Tags:  
  • C#
  • Related