我如何在c中创建字母P

How do I create the letter P in c

我有点麻烦。我在字母 A 下方写下的代码,我不知道如何在右侧切割以使其看起来像字母 P。我知道这对你们中的一些人来说很简单,但我真的需要这个帮助。

#include<stdio.h>
main(){
int rows,position,i,j;
do{
  printf("insert rows, it must be odd number:");
  scanf("%d",&rows);
}while(rows%2==0);
printf("Insert number of positions, it must be at least half of rows");
scanf("%d",&positions);
for(i=1;i<=rows;i++){
  for(j=1;j<=position;j++){
        if(i==1 || i==(rows/2)+1 || j==1 || j==positions){
printf("/ ");
        }
        else{
           printf("  ");
          }
       }
printf("\n");
}


example:
rows:13
positions:7

now goes print:
///////
/     /
/     /
/     /
/     /
/     /
///////
/     /
/     /
/     /
/     /
/     /
/     /

我需要的是这个

///////
/     /
/     /
/     /
/     /
/     /
///////
/     
/     
/     
/     
/     
/     

在您的 if 语句中,更改:

j==positions

至:

(j==positions && i <= (rows/2)+1)

这将在 i 通过 (rows/2)+1 之后阻止该列。