-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
XuanThuLab
committed
Aug 8, 2020
1 parent
a4a4257
commit a49d0d5
Showing
6 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
// Use IntelliSense to find out which attributes exist for C# debugging | ||
// Use hover for the description of the existing attributes | ||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Core Launch (console)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
// If you have changed target frameworks, make sure to update the program path. | ||
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/CS003_ArithmeticAssignment.dll", | ||
"args": [], | ||
"cwd": "${workspaceFolder}", | ||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console | ||
"console": "internalConsole", | ||
"stopAtEntry": false | ||
}, | ||
{ | ||
"name": ".NET Core Attach", | ||
"type": "coreclr", | ||
"request": "attach", | ||
"processId": "${command:pickProcess}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/CS003_ArithmeticAssignment.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/CS003_ArithmeticAssignment.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"watch", | ||
"run", | ||
"${workspaceFolder}/CS003_ArithmeticAssignment.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
|
||
namespace CS003_ArithmeticAssignment | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
|
||
// // Cộng - Trừ | ||
// int a = 28; | ||
// int b = 10; | ||
// Console.WriteLine(a + b); // In ra: 38 | ||
// Console.WriteLine(a - b); // In ra: 18 | ||
|
||
// // Nhân | ||
// float a = 1.2f; | ||
// int b = 3; | ||
// Console.WriteLine(a * b); // In ra 3.6 | ||
|
||
// // Chia | ||
// float a = 1.2f; | ||
// int b = 3; | ||
// Console.WriteLine(a / b); // In ra 0.4 | ||
|
||
// // Chia 2 số nguyên | ||
// int a = 10; | ||
// int b = 3; | ||
// Console.WriteLine(a / b); // In ra 3 | ||
// Console.WriteLine(a / (float)b); // In ra 3.333333 | ||
|
||
// // Chia lấy dư | ||
// int a = 8; | ||
// int b = 3; | ||
// Console.WriteLine(a % b); // In ra 2 | ||
|
||
// // Độ ưu tiên | ||
// Console.WriteLine(5 + 3 * 2); // 11 | ||
// Console.WriteLine(6 / 2 + 3 * 2); // 9 | ||
// Console.WriteLine(6 / (2 + 3) * 2); // 2 | ||
|
||
// // Toán tử gán = | ||
// int x = 10 + 12; // x bằng 22 | ||
// Console.WriteLine(x); | ||
|
||
// // Toán tử += | ||
// int x = 10; | ||
// x += 2; // x bằng 12 | ||
|
||
// // Toán tử -= | ||
// int c = 10; | ||
// c -= 3; // c = 7 | ||
|
||
// //Toán tử *= | ||
// int x = 2; | ||
// x *= 3; //x = 6 | ||
|
||
|
||
|
||
//// Tăng - Giảm | ||
// int a = 10; | ||
// a++; // a là 11 (thêm 1) | ||
// ++a; // a là 12 (thêm 1) | ||
|
||
// a--; // a là 11 (bớt 1) | ||
// --a; // a là 10 (bớt 1) | ||
|
||
// int a = 5; | ||
// int b = 2 * a++; // b = 10; a = 6 | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## Ví dụ về các toán tử số học (Arithmetic Operators) và toán tử gán (Assignment Operators) | ||
https://xuanthulab.net/cac-toan-tu-tinh-toan-so-hoc-trong-c-toan-tu-gan-va-tang-giam.html |