1到100,十位或则个位或则是7的倍数,打印数字和敲桌子

 1 #include<iostream>
 2 using namespace std;
 3 int main()
 4 {
 5     for (int i = 0; i < 100; i++) {
 6         int bai = i / 100;
 7         int shi = (i / 10) % 10;
 8         int ge = i % 10;
 9         if ((shi==7)||(ge==7)||(i%7==0) ){
10             cout << i << endl;
11             cout << "敲桌子" << endl;
12         }
13     }
14     
15     system("pause");
16     return 0;
17 }

 

posted on 2022-11-09 09:31  小凉拖  阅读(20)  评论(0编辑  收藏  举报