Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完成了running letter #39

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
22 changes: 22 additions & 0 deletions level1/p01_runningLetter/runningR.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include<stdio.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

源代码的文件后缀应该是 .c

#define WIDTH 119
int main()
{
int r=0,i=0,j=0;
while(1)
{
for(i=0;i<WIDTH;i++)
{
for(j=0;j<=i;j++)printf(" ");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缩进不对

printf("R");
system("cls");
}
for(i=WIDTH-1;i>=0;i--)
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两段代码有点像,请尝试消除重复部分

for(j=i-1;j>=0;j--)printf(" ");
printf("R");
system("cls");
}
}
return 0;
}
6 changes: 6 additions & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include<stdio.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件删掉吧

int main()
{
printf("hello world");
return 0;
}