Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void fint(int border_size, char name[])
- {
- int a = 0;
- while (name[a]!='\0')
- {
- if (name[a] != '\0')
- ++a;
- }
- for (int i = 0; i < a+ border_size*2; i++)
- {
- cout<<"-";
- }
- char fstring[20];
- sprintf_s(fstring, "\n|\n|%%-%dc%%s%%%dc\n|\n", border_size, border_size);
- printf(fstring,' ',name,'|');
- for (int i = 0; i <a+ border_size * 2;i++)
- {
- cout << "-";
- }
- cout << endl;
- }
- int main()
- {
- char word[50];
- cout << " Enter word! ";
- cin.getline(word, 50);
- fint(10, word);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement