提交 142d462a 编写于 作者: L luxin

add 20 exercises

上级 ca3bba33
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"变量",
"C语言"
],
"children": [],
"export": [
{
"file": "variables.c",
"variants": "variables.json",
"depends": []
}
]
}
\ No newline at end of file
#include <stdio.h>
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
{
"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
# 变量:求正整数的平方
使用while循环修改变量值,依次打印10以内(包含10)所有正整数的平方。请从以下选项中找出正确答案。
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册