用二重循环打印以下图行 1 12 123 1234 12345
include <iostream> using namespace std;int main(void){ for(int row = 1; row < 6; row++){ for(int col = 1; col <= row; col++){ cout << col;} cout << " "; \/\/这个里面是空格 } return 0;}
1 12 123 1234 12345 用二重循环,由用户在控制台输入
void main(void){ int i,j,n;printf("请输入n:\\n");scanf("%d",&n);for(i=1;i<=n;i++){ for(j=1;j<=i;j++){ printf("%d",j);} printf("\\n");} }