Powered By Blogger

un poco mas de programacion en C++


/** Este código es tipo maratón y lo que hace es dibujar gradas, solo tienen que ingresar tres números el primero es el tamaño del cuadrado de puntos, el segundo es el numero de líneas de asteriscos y el tercero las veces que aparecen los cuadros **//



¡¡ QUE SE DIVIERTAN !!

#include
#include
using namespace std;


int main()
{
int s = 0;
int t = 0;
int n = 0;
int caso = 1;
cin >> s >> t >> n;
while(s != 0)
{
cout << "Case " << caso++ << ":\n";
int max = (s*n) + (t*(n+1));
for(int k = 0 ; k < n ; k++)
{
for(int j = 0 ; j < t ; j++)
{
for(int i = 0 ; i < max ; i++)
{
cout << '*';
}
cout << endl;
}

for(int k = 0 ; k < s ; k++)
{
for(int j = 0 ; j < n ; j++)
{
for(int i = 0 ; i < t ; i++)
cout << '*';
for(int i = 0 ; i < s ; i++)
cout << '.';
}
for(int i = 0 ; i < t ; i++)
cout << '*';
cout << endl;
}
}
for(int j = 0 ; j < t ; j++)
{
for(int i = 0 ; i < max ; i++)
{
cout << '*';
}
cout << endl;
}
cout << endl;
cin >> s >> t >> n;
}
return 0;
}
//.. Si necesitan ayuda con un código háganlo saber..//

No hay comentarios: