Dev - C++ - Como voltear horizontalmente un triangulo en c++ por favor es urgente

 
Vista:
sin imagen de perfil

Como voltear horizontalmente un triangulo en c++ por favor es urgente

Publicado por Maria (3 intervenciones) el 07/12/2020 23:45:43
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
using namespace std;
 
int main(int argc, char *argv[]) {
	for(int i=4; i<=10; i++){
		cout<<"  ";
		for(int j=0; j<10-i; j++){
			cout<<"*";
		}
		cout<<" \n";
	}
	return 0;
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Alfil
Val: 4.344
Oro
Ha mantenido su posición en Dev - C++ (en relación al último mes)
Gráfica de Dev - C++

Como voltear horizontalmente un triangulo en c++ por favor es urgente

Publicado por Alfil (1444 intervenciones) el 08/12/2020 00:03:35
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
41
#include <iostream>
 
using namespace std;
 
int main(int argc, char *argv[])
{
    for (int i = 0; i <= 10; i++)
    {
        for (int j = 0; j < 10 - i; j++)
            cout << "*";
 
        cout << endl;
    }
 
    cout << endl;
 
    for (int i = 10; i > 0; i--)
    {
        for (int j = 10; j > 0 + i; j--)
            cout << "*";
 
        cout << endl;
    }
 
    cout << endl;
 
    int n = 0;
    for (int i = 10; i > 0; i--)
    {
        for (int j = 10; j > 0 + i; j--)
            cout << " ";
 
        for (int k = 0; k < 10 - n; k++)
            cout << "*";
 
        n++;
        cout << endl;
    }
 
    return 0;
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar