From 499aab9e46b8c242f281d1b13958621acbb40b8f Mon Sep 17 00:00:00 2001 From: Namu Date: Sat, 13 Sep 2025 18:22:31 +0200 Subject: [PATCH] Ajoutez des fichiers projet. --- TestSonarqube.sln | 25 +++++++++++++++ TestSonarqube/Program.cs | 50 ++++++++++++++++++++++++++++++ TestSonarqube/TestSonarqube.csproj | 10 ++++++ 3 files changed, 85 insertions(+) create mode 100644 TestSonarqube.sln create mode 100644 TestSonarqube/Program.cs create mode 100644 TestSonarqube/TestSonarqube.csproj diff --git a/TestSonarqube.sln b/TestSonarqube.sln new file mode 100644 index 0000000..4f3e236 --- /dev/null +++ b/TestSonarqube.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36408.4 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestSonarqube", "TestSonarqube\TestSonarqube.csproj", "{9EF861DD-89C0-45EC-8914-A1FAD9052B77}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9EF861DD-89C0-45EC-8914-A1FAD9052B77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9EF861DD-89C0-45EC-8914-A1FAD9052B77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9EF861DD-89C0-45EC-8914-A1FAD9052B77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9EF861DD-89C0-45EC-8914-A1FAD9052B77}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3E9CFC24-9941-4BA0-907B-B04BCFE6BB74} + EndGlobalSection +EndGlobal diff --git a/TestSonarqube/Program.cs b/TestSonarqube/Program.cs new file mode 100644 index 0000000..85e17cb --- /dev/null +++ b/TestSonarqube/Program.cs @@ -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}"); +} diff --git a/TestSonarqube/TestSonarqube.csproj b/TestSonarqube/TestSonarqube.csproj new file mode 100644 index 0000000..2150e37 --- /dev/null +++ b/TestSonarqube/TestSonarqube.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + +