fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.1s 54648KB
stdin
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw, ImageFont

# Tạo ảnh trắng (RGBA) với nền trong suốt
seal_size = 800
image = Image.new('RGBA', (seal_size, seal_size), (255, 255, 255, 0))
draw = ImageDraw.Draw(image)

# Cấu hình
center = seal_size // 2
radius_outer = 370
radius_inner = 270

# Font (dự phòng, không dùng font tiếng Việt đặc biệt do hạn chế môi trường)
font_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
font_large = ImageFont.truetype(font_path, 38)
font_medium = ImageFont.truetype(font_path, 34)

# Vẽ vòng tròn ngoài và trong
draw.ellipse(
    (center - radius_outer, center - radius_outer, center + radius_outer, center + radius_outer),
    outline='red', width=10
)
draw.ellipse(
    (center - radius_inner, center - radius_inner, center + radius_inner, center + radius_inner),
    outline='red', width=4
)

# Viết chữ ngoài vòng tròn
outer_text = "ĐOÀN TNCS HỒ CHÍ MINH"
bottom_text = "TỈNH BÌNH ĐỊNH"

# Vẽ chữ chạy vòng cung (góc khoảng 180 độ)
for i, char in enumerate(outer_text):
    angle = -90 - (len(outer_text) / 2 - i) * 8
    x = center + radius_outer * 0.85 * np.cos(np.radians(angle))
    y = center + radius_outer * 0.85 * np.sin(np.radians(angle))
    draw.text((x, y), char, font=font_medium, fill='red', anchor='mm')

# Vẽ chữ dưới (TỈNH BÌNH ĐỊNH)
for i, char in enumerate(bottom_text):
    angle = 90 + (len(bottom_text) / 2 - i) * 8
    x = center + radius_outer * 0.85 * np.cos(np.radians(angle))
    y = center + radius_outer * 0.85 * np.sin(np.radians(angle))
    draw.text((x, y), char, font=font_medium, fill='red', anchor='mm')

# Viết chữ giữa
draw.text((center, center - 20), "BAN CHẤP HÀNH", font=font_large, fill='red', anchor='mm')
draw.text((center, center + 30), "TỈNH ĐOÀN", font=font_large, fill='red', anchor='mm')

# Hiển thị
plt.imshow(image)
plt.axis('off')
plt.title("Dấu mộc phục dựng (số hóa)")
plt.show()
stdout
Standard output is empty