Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenges/6-numeros-primos/typescript/clintonrocha98 #157

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
640a1b8
Finalizando o desafio
Clintonrocha98 Oct 3, 2023
ba48b63
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 3, 2023
eface50
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 3, 2023
b70f211
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 3, 2023
49df35d
Finalizando o desafio
Clintonrocha98 Oct 3, 2023
5dbc697
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 3, 2023
d7dce94
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
d58d4af
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
1a880aa
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
ab5488d
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
9db44ee
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
3660251
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
adc5399
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
9a496f9
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
6f2e56e
Finalizando o desafio
Clintonrocha98 Oct 4, 2023
028db35
Finalizando o desafio
Clintonrocha98 Oct 4, 2023
a618421
Merge remote-tracking branch 'upstream/main'
Clintonrocha98 Oct 4, 2023
abf9afc
Finalizando o desafio
Clintonrocha98 Oct 4, 2023
6964971
Merge branch 'main' into challenges/0-hello-world/typescript/clintonr…
Clintonrocha98 Oct 4, 2023
4f37781
Finalizando o desafio
Clintonrocha98 Oct 4, 2023
01c83b4
Finalizando o desafio
Clintonrocha98 Oct 4, 2023
e081055
Finalizando o desafio
Clintonrocha98 Oct 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Exercicio:** 0 - Hello World

**Nickname:** clintonrocha
**Nickname:** clintonrocha98

**Nível Técnico:** - Junior

Expand All @@ -16,7 +16,7 @@

**Como rodar o desafio**:

Use o comando abaixo:
Dentro do diretório do projeto, utilize o comando abaixo:
```bash
npx ts-node hello-world.ts
```
22 changes: 22 additions & 0 deletions challenges/6-numeros-primos/typescript/clintonrocha98/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Submissão de Exercicio

**Exercicio:** 6 - Numeros Primos

**Nickname:** clintonrocha98

**Nível Técnico:** - Junior

**Empresa:** Nenhuma

**Twitter**:

**Dificuldade de Resolução:** Baixa

**Comentários:**

**Como rodar o desafio**:

Dentro do diretório do projeto, utilize o comando abaixo:
```bash
npx ts-node numeros-primos.ts
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as readline from "readline";

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question("number: ", (input: string) => {
function isPrime(value: string) {
const newValue = Number(value);
if (newValue <= 1) {
return false;
}
if (newValue <= 3) {
return true;
}

if (newValue % 2 === 0 || newValue % 3 === 0) {
return false;
}

for (let i = 5; i * i <= newValue; i += 6) {
if (newValue % i === 0 || newValue % (i + 2) === 0) {
return false;
}
}

return true;
}
console.log(isPrime(input));
rl.close();
});
22 changes: 0 additions & 22 deletions challenges/model.md

This file was deleted.

Loading