diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c531b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Claude Code configuration +.claude/ + +# Python bytecode +__pycache__/ +*.py[cod] +*$py.class + +# IDE files +.vscode/ +.idea/ +*.swp +*.swo + +# OS files +.DS_Store +Thumbs.db + +# Virtual environments +venv/ +env/ +.env \ No newline at end of file diff --git a/test.py b/test.py new file mode 100644 index 0000000..2fe20eb --- /dev/null +++ b/test.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +九九乘法表程序 +打印完整的9x9乘法表 +""" + +def print_multiplication_table(): + """打印九九乘法表""" + print("九九乘法表:") + print("=" * 50) + + # 打印表头 + print(" ", end="") + for i in range(1, 10): + print(f"{i:4}", end="") + print() + print("-" * 50) + + # 打印乘法表内容 + for i in range(1, 10): + print(f"{i} |", end="") + for j in range(1, 10): + print(f"{i*j:4}", end="") + print() + + print("=" * 50) + +def print_triangle_multiplication_table(): + """打印三角形格式的九九乘法表""" + print("\n三角形格式九九乘法表:") + print("=" * 30) + + for i in range(1, 10): + for j in range(1, i + 1): + print(f"{j}×{i}={i*j:2}", end=" ") + print() + + print("=" * 30) + +if __name__ == "__main__": + print_multiplication_table() + print_triangle_multiplication_table() \ No newline at end of file diff --git a/开发及提交要求.txt.txt b/开发及提交要求.txt.txt new file mode 100644 index 0000000..21cb516 --- /dev/null +++ b/开发及提交要求.txt.txt @@ -0,0 +1 @@ +请基于当前目录下完成一个九九乘法表的test.py程序,提交并推送远程仓库ssh://git@82.156.249.211:2222/htdw766/aicode.git \ No newline at end of file