题解 | #X形图案#
X形图案
https://www.nowcoder.com/practice/83d6afe3018e44539c51265165806ee4
#include<stdio.h> int main(){ int n,i,j; while(scanf("%d",&n)!=EOF){ for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(j==i||j==n-i-1) { printf("*"); } else printf(" "); } printf("\n"); } } }#菜狗的解题#