From 142d462a2931a4662e577057847505b5f2052541 Mon Sep 17 00:00:00 2001 From: luxin Date: Wed, 20 Oct 2021 10:04:13 +0800 Subject: [PATCH] add 20 exercises --- .../1.\345\217\230\351\207\217/config.json" | 15 +++++++++++++++ .../1.\345\217\230\351\207\217/variables.c" | 18 ++++++++++++++++++ .../1.\345\217\230\351\207\217/variables.json" | 13 +++++++++++++ .../1.\345\217\230\351\207\217/variables.md" | 3 +++ 4 files changed, 49 insertions(+) create mode 100644 "data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/config.json" create mode 100644 "data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.c" create mode 100644 "data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.json" create mode 100644 "data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.md" diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/config.json" new file mode 100644 index 0000000..86e92ba --- /dev/null +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/config.json" @@ -0,0 +1,15 @@ +{ + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "变量", + "C语言" + ], + "children": [], + "export": [ + { + "file": "variables.c", + "variants": "variables.json", + "depends": [] + } + ] +} \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.c" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.c" new file mode 100644 index 0000000..e0dc212 --- /dev/null +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.c" @@ -0,0 +1,18 @@ +#include + +int main() +{ + int num = 1; + int max_num = 10; + int step = 1; + int result = 0; + + while (num <= max_num) + { + result = num * num; + printf("%d ^ 2 = %d\n", num, result); + num = num + step; + } + + return 0; +} \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.json" new file mode 100644 index 0000000..6cb50f3 --- /dev/null +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.json" @@ -0,0 +1,13 @@ +{ + "multiline": [ + { + "int step = 1;": "int step = 2;" + }, + { + "while (num <= max_num)": "while (num < max_num)" + }, + { + "num = num + step;": "num + step;" + } + ] +} \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.md" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.md" new file mode 100644 index 0000000..6a781bf --- /dev/null +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/variables.md" @@ -0,0 +1,3 @@ +# 变量:求正整数的平方 + +使用while循环修改变量值,依次打印10以内(包含10)所有正整数的平方。请从以下选项中找出正确答案。 \ No newline at end of file -- GitLab