分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
有意思,看下面程序:
#include <iostream>using namespace std;bool isSpecialTime(int hour, int minute){ /* [8:20 <= x:yz < 10:40) <==> 8.20 <= x.yz < 10.40 <==> 820 <= 100x + 10y + z < 1040 <==> 820 <= 100 * hour + minute < 1040 */ int result = 100 * hour + minute; if(result >= 820 && result < 1040) return true; return false;}int main(){ int hour; int minute; for(hour = 7; hour < 12; hour++) { for(minute = 0; minute < 60; minute++) { if(isSpecialTime(hour, minute)) { if(minute >= 10) cout << hour << ":" << minute << endl; else cout << hour << ":" << "0" << minute << endl; } } } return 0;}
给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
![这里写图片描述](https://i-blog.csdnimg.cn/blog_migrate/2e19ffb3303a490d20ea5d00dd397156.gif)