从1开始到数字100,如果数字个位含有7,或者数字十位含有7,或者是7的倍数,我们打印输出敲桌子,其余数字直接打印输出
#include<iostream>
using namespace std;
int main()
{
for (int i = 1; i < 100; i++)
{
if (i % 10 == 7 || i % 7 == 0 || i /10 == 7)
{
cout << "敲桌子" << endl;
}
else
{
cout << i << endl;
}
}
system("pause");
return 0;
}