Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <stdio.h>
- #include <cstdio>
- #include <cstdlib>
- #include <conio.h>
- #include <cmath>
- #include <windows.h>
- #include <ctime>
- #include <string>
- #include <dos.h>
- #include <dir.h>
- #include <fstream>
- #include <math.h>
- #include <time.h>
- #include <ctype.h>
- using namespace std;
- void gotoxy(int x, int y)
- {
- COORD c;
- c.X = x-1;
- c.Y = y-1;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
- }
- int main()
- {
- string txt;
- char corner;
- char border;
- HANDLE hOut;
- hOut = GetStdHandle( STD_OUTPUT_HANDLE );
- cout<<"TEKST: ";
- cin>>txt;
- cout<<"ROG: ";
- cin>>corner;
- cout<<"RAMKA: ";
- cin>>border;
- int kolor_napis;
- cout<<"JAKI KOLOR NAPISU: "<<endl;
- cout<<"1. CZERWONY"<<endl;
- cout<<"2. NIEBIESKI"<<endl;
- cout<<"3. ZIELONY"<<endl;
- cout<<"CYFRA: ";
- cin>>kolor_napis;
- int kolor_ramka;
- cout<<"JAKI KOLOR RAMKI : "<<endl;
- cout<<"1. CZERWONY"<<endl;
- cout<<"2. NIEBIESKI"<<endl;
- cout<<"3. ZIELONY"<<endl;
- cout<<"CYFRA : ";
- cin>>kolor_ramka;
- system ("cls");
- gotoxy (1, 1 );
- cout<<"x";
- gotoxy (120, 1);
- cout<<"x";
- int i = 1;
- while (i<30)
- {
- gotoxy((i*4),(1+i));
- cout<<border;
- gotoxy((120-(i*4)),(1+i));
- cout<<border;
- i++;
- }
- switch(kolor_napis)
- {
- case 1:
- SetConsoleTextAttribute( hOut, FOREGROUND_RED );
- break;
- case 2:
- SetConsoleTextAttribute( hOut, FOREGROUND_BLUE );
- break;
- case 3:
- SetConsoleTextAttribute( hOut, FOREGROUND_GREEN );
- break;
- }
- int dlugosc=txt.length();
- gotoxy((60-dlugosc/2), 16);
- cout<<txt;
- switch(kolor_ramka)
- {
- case 1:
- SetConsoleTextAttribute( hOut, FOREGROUND_RED );
- break;
- case 2:
- SetConsoleTextAttribute( hOut, FOREGROUND_BLUE );
- break;
- case 3:
- SetConsoleTextAttribute( hOut, FOREGROUND_GREEN );
- break;
- }
- gotoxy(1,1);
- cout<<corner;
- gotoxy(120,1);
- cout<<corner;
- gotoxy(1,30);
- cout<<corner;
- gotoxy(120,30);
- cout<<corner;
- int z=0;
- while(z<118)
- {
- gotoxy(2+z,1);
- cout<<border;
- gotoxy(2+z,30);
- cout<<border;
- z++;
- }
- int p=0;
- while(p<28)
- {
- gotoxy(1,2+p);
- cout<<border;
- gotoxy(120,2+p);
- cout<<border;
- p++;
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement