C language programming> 20th week ⑥ Please add the main function. The function of this function is to print out all three digits that meet the requirements of the ones digit, the tens digit, and the hundreds digit.

Example: Please add the main function. The function of this function is to print out all three digits that satisfy the number in the ones place, the number in the tens place, and the number in the hundreds place.

本题的结果为:111 222 333 444 555 666 777 888 999。
仅在横线上填写所需要的若干表达式或语句,请勿改动函数中的其它任何内容。

代码如下:

#include<stdio.h>
main()
{
    
    
	int x,y,z;
	for(x=1;x<10;x++)
		for(y=1;y<10;y++)
			for(z=1;z<10;z++)
				if(x==y&&y==z)
					printf("%5d",x+y*10+z*100);
}

The output running window is as follows:
Insert picture description here

越努力越幸运!
加油,奥力给!!!

Guess you like

Origin blog.csdn.net/qq_45385706/article/details/112799697