'commit'
This commit is contained in:
19
C++课程/第十二课二进制进阶与多重循环/左三角形.cpp
Normal file
19
C++课程/第十二课二进制进阶与多重循环/左三角形.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include<stdio.h>
|
||||
int main() {
|
||||
int i,n;
|
||||
for(i=1; i<=7; i+=2) {
|
||||
for(n=1; n<=i; n++) {
|
||||
printf("* ");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
for(i=5; i>=1; i-=2) {
|
||||
for(n=1; n<=i; n++) {
|
||||
printf("* ");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user