-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Envio do desafio 02 por @JefersonMarcante
- Loading branch information
1 parent
18fc914
commit a7403e2
Showing
2 changed files
with
30 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,20 @@ | ||
bool EhPrimo(int num) | ||
{ | ||
int aux = 0; | ||
|
||
if (num < 2) | ||
return false; | ||
|
||
for(int j = 2; j <= num; j++) | ||
if (num % j == 0) | ||
aux++; | ||
|
||
if (aux <= 1) | ||
return true; | ||
|
||
return false; | ||
} | ||
|
||
for (int i = 0; i < 10000; i++) | ||
if (EhPrimo(i)) | ||
Console.WriteLine(i); |
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,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |