用C写的代码咋报错了,刚学没多久,大佬们轻点喷
查看原帖
用C写的代码咋报错了,刚学没多久,大佬们轻点喷
1534254
Byt3W1sp楼主2024/11/12 20:36
#include <stdio.h>

int main()
{
	// get put n
	int n;
	scanf("%i", &n);
	// create a variable to storge the 2d number to be print
	int count = 1;
	// caculate
	// first think of the lines
	for (int i = 0; i < n; i++)
	{
		// second think of the detail
		for (int j = 0; j < n - i; j++)
		{
			if (count <= 10)
			{
				printf("0%i", count);
			}
			else
			{
				printf("%i", count);
			}
			
			count ++;
		}
		
		printf("\n");
	}
	
	return 0;
}
2024/11/12 20:36
加载中...