fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5. char message[] = "Get Well Soon!";
  6. int width = 40; // Width of the heart pattern
  7.  
  8. // Upper part of the heart
  9. printf("\n");
  10. for (int i = 0; i < 3; i++) {
  11. for (int j = 0; j <= width; j++) {
  12. if ((j >= 6 - i && j <= 14 + i) || (j >= 26 - i && j <= 34 + i)) {
  13. printf("❤️");
  14. } else {
  15. printf(" "); // Double spaces for better alignment
  16. }
  17. }
  18. printf("\n");
  19. }
  20.  
  21. // Middle part of the heart
  22. for (int i = 0; i < 3; i++) {
  23. for (int j = 0; j <= width; j++) {
  24. if ((j >= i && j <= width - i)) {
  25. if (i == 1 && j == (width - strlen(message)) / 2) {
  26. printf("%s", message); // Centered Message
  27. j += strlen(message) - 1; // Skip the message width
  28. } else {
  29. printf("❤️");
  30. }
  31. } else {
  32. printf(" ");
  33. }
  34. }
  35. printf("\n");
  36. }
  37.  
  38. // Lower part of the heart
  39. for (int i = 0; i < 8; i++) {
  40. for (int j = 0; j <= width; j++) {
  41. if (j >= i && j <= width - i) {
  42. printf("❤️");
  43. } else {
  44. printf(" ");
  45. }
  46. }
  47. printf("\n");
  48. }
  49.  
  50. // Aesthetic well-wish message
  51. printf("\n💖🌸 Stay strong, take care & recover soon! 🌸💖\n\n");
  52.  
  53. return 0;
  54. }
  55.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
            ❤️❤️❤️❤️❤️❤️❤️❤️❤️                      ❤️❤️❤️❤️❤️❤️❤️❤️❤️            
          ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️                  ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️          
        ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️              ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️        
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
  ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️Get Well Soon!❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️  
    ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️    
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
  ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️  
    ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️    
      ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️      
        ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️        
          ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️          
            ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️            
              ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️              

💖🌸 Stay strong, take care & recover soon! 🌸💖