Jump to content

[C++] Cum sa scrii colorat in consola


FnZ
 Share

Recommended Posts

Bineinteles ca aveti nevoie de un include special in afara de <iostream>

#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
    HANDLE hConsole;
    int k;

    hConsole = GetStdHandle(STD_OUTPUT_HANDLE);


    for(k = 1; k < 12; k++)
    {

        SetConsoleTextAttribute(hConsole, k);
        cout << k << "............((......." << endl;
        cout << k << "............( , ).........." <<endl;
        cout << k << "............_`|'_........." <<endl;
        cout << k << "...........| () ||........" <<endl;
        cout << k << "...........|.....||......." <<endl;
        cout << k << "...........|. #.|........" <<endl;
        cout << k << "...........|. #.|.........." <<endl;
        cout << k << "...........|. #.|.........." <<endl;
        cout << k << "...........|. #.|.........." <<endl;
        cout << k << "...........|. #.|.........." <<endl;
        cout << k << ".......____|----|____....." <<endl;
        cout << k << "......(______________)..." <<endl;
    }

    cin.get();
    return 0;
}

In figura din imagine am facut o lumanare care va fi colorata si fundalul consolei la fel. Mult Succes. Daca aveti nelamuriri trimiteti un PM la mine.

Edited by TheLittle
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.