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 sorryCodePudding 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 \ nWriteLine a newline
CodePudding user response:
The