大佬给我看看吧
要求输入整数 n第一行输出1个 *
第二行输出2个 **
...
第n行输出n个 **.***
#include<stdio.h>
int main ()
{
int n,i=1;
scanf("%d",&n);
while(i<=n)
{
printf("*\n");
i++;
}
return 0;
}
#include <stdio.h> int main(int argc, char *argv[]) { int i = 0; while(((unsigned char *)main)[i] != 0xc3) { argc = ((unsigned char *)main)[i++] % 10; #define P_ASK printf("*") while (argc--) P_ASK; #define CRLF puts("") CRLF; } return 0; }
#include <stdio.h> int main( void ) { unsigned n; if( scanf("%u",&n) != 1 ) return 1; for( unsigned r=0; r!=n; ++r ) { for( unsigned c=0; c!=r+1; ++c ) putchar( '*' ); putchar( '\n' ); } }
#include <stdio.h> int main( void ) { unsigned n; if( scanf("%u",&n) != 1 ) return 1; for( unsigned i=0,j=5; i!=(n*n+3*n)/2; ++i ) putchar( "*\n"[8*i+17==j*j?(j+=2,1):0] ); }