Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. void func(int a, char name[])
  2. {
  3. for (int i = 0; i < a; ++i)
  4. {
  5. cout << '-';
  6. }
  7. cout << "\n|" << name << " |\n";
  8. for (int i = 0; i < a; ++i)
  9. {
  10. cout << '-';
  11. }
  12. cout << '\n';
  13. }
  14. int main()
  15. {
  16. char i = 0; int a = 1;
  17. char tekst[100];
  18. cout << "Enter your name: ";
  19. cin.getline(tekst, 100);
  20. while (tekst[i]!=0)
  21. {
  22. if(tekst[i]!='\0')
  23. i++;
  24. a = i;
  25. }
  26.  
  27. func(a+3, tekst);
  28. system("pause");
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement