游客 Signup | Login
中文 | En

2990 - 循环练习23

如果一个自然数的数字之积加上这些数字之和,正好等于这个自然数,我们称这样的自然数为"巧数",求100以内的所有巧数.

Input

无输入

Output

一行,多个数之间用逗号隔开,末尾无逗号。

Examples

Input


                

Output


                

Solution C++

#include <iostream>

using namespace std;

int main()
{
	bool flag=true;
	for(int i=11;i<=99;++i)
	{
		int a=i/10,b=i%10;
		if(a*b+a+b==a*10+b)
		{
			if(flag==true)
			{
				cout << a*10+b;
				flag=false;
			}
			else
			cout << "," << a*10+b;
		}
	}
	return 0;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题