程序输出字符乱码为正方形_C程序使用字符*打印下面的正方形

《程序输出字符乱码为正方形_C程序使用字符*打印下面的正方形》

程序输出字符乱码为正方形

#include<stdio.h> #include<conio.h>

void main() { int i,j,n; clrscr(); //to clear the screen printf(“Enter size of the square:”); scanf(“%d”,&n); for(i=0;i<n;++i) { printf(“n”); for(j=0;j<n;++j) { if(i==0||i==n-1||j==0||j==n-1) printf(“*”); else printf(” “); } } getch(); //to stop the screen }
#include<stdio.h> #include<conio.h>

void main() { int i,j,n; clrscr(); //to clear the screen printf(“Enter size of the square:”); scanf(“%d”,&n); for(i=0;i<n;++i) { printf(“n”); for(j=0;j<n;++j) { if(i==0||i==n-1||j==0||j==n-1) printf(“*”); else printf(” “); } } getch(); //to stop the screen }

翻译自: https://www.thecrazyprogrammer.com/2012/07/c-program-to-print-following-square_25.html

程序输出字符乱码为正方形

    原文作者:culing2941
    原文地址: https://blog.csdn.net/culing2941/article/details/108650971
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞