输出对角线(输出格式控制)

#include <stdio.h>

int main(void)
{
    int i;
    int x;        /* 瑕佹樉绀虹殑琛屾暟 */

    printf("hello world");
    scanf("%d", &x);

    for (i = 1; i <= x; i++)
        printf("%*d\n", i, i % 10);

    return 0;
}

输出

hello world6
1
 2
  3
   4
    5
     6

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/11037612.html