分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
#include <iostream>using namespace std;void outputUnique(char * str, int n){ if(n <= 0) { return; } else if(n == 1) { putchar(str[0]); } else { int i = 0, j = 1; putchar(str[0]); while(j < n) { if(str[j] != str[i]) { putchar(str[j]); i = j; } ++j; } }}void main(){ outputUnique("abbbcdde", 8);}// Output:/*abcde*/