今天学的for循环,好不容易整出来了,呼呼
/*
*********
*******
*****
***
*/
#include<stdio.h>
int main(){
for (int hang = 1; hang <= 4; hang++) {
for (int lie = 1; lie <= 10 - hang; lie++) {
if (lie <= hang - 1) {
printf(" ");
}else{
printf("*");
}
}
printf("\n");
}
return 0;
} |
|