请高手分析一下这道C++题.

来源:百度知道 编辑:UC知道 时间:2024/06/23 23:36:46
#include <iostream.h>
#include <stdio.h>
void main()
{
int I,j;
for(I=4;j=>1;I--)
{for(j=1;j<=I;j++)putchar('#');
for(j=1;j<=4-I;j++)putchar('*');
putchar('\n');}}
运行结果和简要的分析.
请简要分析一下,我遇到几个FOR就不太会的.

结果是:
####
###*
##**
#***
你的程序有错误,正确的应该如下哈:
#include <iostream.h>
#include <stdio.h>
void main()
{
int I,j;
for(I=4;I>=1;I--)
{for(j=1;j<=I;j++)putchar('#');
for(j=1;j<=4-I;j++)putchar('*');
putchar('\n');}}