meu primeiro commit carinhoso
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2.csproj", "{541B4EC7-277F-45A0-AEBC-7EC74B2E191D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{541B4EC7-277F-45A0-AEBC-7EC74B2E191D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{541B4EC7-277F-45A0-AEBC-7EC74B2E191D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{541B4EC7-277F-45A0-AEBC-7EC74B2E191D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{541B4EC7-277F-45A0-AEBC-7EC74B2E191D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,46 @@
|
||||
namespace ConsoleApp2;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
int numerodetentativas = 0;
|
||||
Console.ForegroundColor = ConsoleColor.DarkGreen;
|
||||
Console.WriteLine("Qual o animal secreto?");
|
||||
string tentativa = Console.ReadLine();
|
||||
string animalsecreto = "gato";
|
||||
while (tentativa != "gato")
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
Console.WriteLine("Errou!");
|
||||
tentativa = Console.ReadLine();
|
||||
numerodetentativas++;
|
||||
}
|
||||
Program.VerificarAnimal(tentativa, animalsecreto, numerodetentativas);
|
||||
}
|
||||
static bool VerificarAnimal(string tentativa, string animalsecreto, int numerodetentativas)
|
||||
{
|
||||
if (tentativa == animalsecreto)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.WriteLine("Acertou!");
|
||||
Console.ForegroundColor = ConsoleColor.DarkBlue;
|
||||
Console.WriteLine($"Voce acertou em {numerodetentativas} tentativas");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user