Ajoutez des fichiers projet.
This commit is contained in:
50
TestSonarqube/Program.cs
Normal file
50
TestSonarqube/Program.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
// Fiboonacci sequence
|
||||
|
||||
int Fibonacci(int n)
|
||||
{
|
||||
if (n <= 0) return 0;
|
||||
if (n == 1) return 1;
|
||||
return Fibonacci(n - 1) + Fibonacci(n - 2);
|
||||
}
|
||||
|
||||
// volontary unused variable
|
||||
int x = 10;
|
||||
|
||||
Console.WriteLine(Fibonacci(10));
|
||||
|
||||
if (args.Length > 0)
|
||||
{
|
||||
Console.WriteLine("Arguments:");
|
||||
foreach (var arg in args)
|
||||
{
|
||||
Console.WriteLine(arg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("No arguments provided.");
|
||||
}
|
||||
|
||||
switch (DateTime.Now.DayOfWeek)
|
||||
{
|
||||
case DayOfWeek.Monday:
|
||||
Console.WriteLine("It's Monday!");
|
||||
break;
|
||||
case DayOfWeek.Friday:
|
||||
Console.WriteLine("It's Friday!");
|
||||
break;
|
||||
case DayOfWeek.Sunday:
|
||||
Console.WriteLine("It's Sunday!");
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("It's some other day.");
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Console.WriteLine($"Count: {i}");
|
||||
}
|
||||
10
TestSonarqube/TestSonarqube.csproj
Normal file
10
TestSonarqube/TestSonarqube.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user