├── Consumo-Viagem
└── codigo.cs
├── README.md
├── AlbumCopa
└── Program.cs
└── Animal
└── codigo.cs
/Consumo-Viagem/codigo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | namespace Desafio_1
3 | {
4 | class Program
5 | {
6 | static void Main(string[] args)
7 | {
8 | string[] entrada;
9 | var distancia = 0;
10 | var horas = 0;
11 | var viagem = 0;
12 | decimal gasolina = 0;
13 |
14 | entrada = (Console.ReadLine().Split(' '));
15 | horas = Convert.ToInt32(entrada[0]);
16 | distancia = Convert.ToInt32(entrada[1]);
17 | viagem = (horas * distancia);
18 | gasolina = ((decimal)viagem / 12);
19 | Console.WriteLine(gasolina.ToString("N3"));
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
Desafios de código em C#
BootCamp GFT - Digital Innovation one
2 |
3 | Desenvolvendo Algoritmos com C#
4 |
5 | | Etapa | Desafio | Solução |
6 | |:---:|:------------------------:|:-------:|
7 | | 1 | Cálculo de Viagem | [Código](https://github.com/Anacarlags/Desafios_CodigoCsharp-Bootcamp_GFT/blob/master/Consumo-Viagem/codigo.cs) |
8 | | 2 | Álbum da Copa | [Código](https://github.com/Anacarlags/Desafios_CodigoCsharp-Bootcamp_GFT/tree/master/AlbumCopa) |
9 | | 3 | Animal | [Código]() |
10 |
11 |
12 |
13 | Desenvolvedoras:
14 |
15 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/AlbumCopa/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | class Program {
4 |
5 | static void Main(string[] args) {
6 | int numeroDeFigurinhas = Int32.Parse(Console.ReadLine());
7 | int numeroDeFigurinhasCompradas = Int32.Parse(Console.ReadLine());
8 | int totalDeFigurinhas = 0;
9 |
10 | int[] albumDeFigurinha = new int[numeroDeFigurinhasCompradas];
11 | int[] Repetidas = new int[numeroDeFigurinhas];
12 |
13 | // IMPLEMENTE AQUI A SOLUÇÃO
14 |
15 | for(int i=0; i < numeroDeFigurinhas; i++)
16 | Repetidas[i] = 0;
17 | for (int j=0; j < numeroDeFigurinhasCompradas; j++)
18 | {
19 | albumDeFigurinha[i] = Int32.Parse(Console.ReadLine());
20 | }
21 |
22 |
23 | var contadorDeFigurinhas = 0;
24 | var albumPreenchido = 0;
25 | for (int k = 0; k < numeroDeFigurinhas; k++)
26 | {
27 | for (int l = 0; l < albumDeFigurinha.Length; l++)
28 | {
29 | if (l == albumDeFigurinha[l]-1)
30 | {
31 | Repetidas[k] = 1;
32 | }
33 | }
34 | if(Repetidas[k] == 1)
35 | totalDeFigurinhas++;
36 | }
37 |
38 | Console.WriteLine(numeroDeFigurinhas - totalDeFigurinhas);
39 |
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/Animal/codigo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 |
4 | class MainClass {
5 | public static void Main (string[] args) {
6 | String adj1 ; //declare as suas variaveis
7 | String adj2 ;
8 | String adj3 ;
9 |
10 | adj1 = Console.ReadLine(); //insira suas variaveis
11 | adj2 = Console.ReadLine();
12 | adj3 = Console.ReadLine();
13 |
14 | if (( adj1 == "vertebrado" ) && ( adj2 == "ave" ) && ( adj3 == "carnivoro")) {
15 | Console.WriteLine("aguia\n");
16 | }
17 | else if (( adj1 == "vertebrado" ) && ( adj2 == "ave" ) && ( adj3 == "onivoro" )) {
18 | Console.WriteLine("pomba\n"); }
19 |
20 |
21 | if (( adj1 == "vertebrado" ) && ( adj2 == "mamifero" ) && ( adj3 == "onivoro" )) {
22 | Console.WriteLine("homem\n");
23 | }
24 | else if (( adj1 == "vertebrado" ) && ( adj2 == "mamifero" ) && ( adj3 == "herbivoro" )) {
25 | Console.WriteLine("vaca\n"); }
26 |
27 |
28 | if (( adj1 == "invertebrado" ) && ( adj2 == "inseto" ) && ( adj3 == "hematofago" )) {
29 | Console.WriteLine("pulga\n");
30 | }
31 | else if (( adj1 == "invertebrado" ) && ( adj2 == "inseto" ) && ( adj3 == "herbivoro" )) {
32 | Console.WriteLine("lagarta\n"); }
33 |
34 |
35 | if (( adj1 == "invertebrado") && ( adj2 == "anelideo") && ( adj3 == "hematofago")) {
36 | Console.WriteLine("sanguessuga\n");
37 | }
38 | else if (( adj1 == "invertebrado" ) && ( adj2 == "anelideo" ) && ( adj3 == "onivoro" )) {
39 | Console.WriteLine("minhoca\n"); }
40 | }
41 | }
--------------------------------------------------------------------------------