-
Notifications
You must be signed in to change notification settings - Fork 126
/
solucao.cs
40 lines (38 loc) · 1.1 KB
/
solucao.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**********************************************************************************************
*
* 1/5 - Quadrado e ao Cubo
*
******************************** Desafio:
*
* Você terá o desafio de escrever um programa que leia um valor inteiro N (1 < N < 1000).
* Este N é a quantidade de linhas de saída que serão apresentadas na execução do programa.
*
******************************** Entrada:
*
* O arquivo de entrada contém um número inteiro positivo N.
*
******************************** Saída:
*
* Imprima a saída conforme o exemplo fornecido.
*
**********************************************************************************************/
using System;
class QuadradoEAoCubo
{
static void Main()
{
var numero = Int32.Parse(Console.ReadLine());
if(numero != null)
{
for(int i = 1; i <= numero; i++)
{
var numeros = $"{i} {i * i} {i * i * i}";
Console.WriteLine(numeros);
}
}
else
{
Console.WriteLine("Insira um número!");
}
}
}