Skip to content

Instantly share code, notes, and snippets.

@gavr123456789
Created February 9, 2019 13:30
Show Gist options
  • Save gavr123456789/9b8d585cba47a4afe2e0f7e485e0e0e3 to your computer and use it in GitHub Desktop.
Save gavr123456789/9b8d585cba47a4afe2e0f7e485e0e0e3 to your computer and use it in GitHub Desktop.
using Gee;
void main(string[] args) {
var s="asds";var result = false;
unichar c;
var records = new HashMap<unichar, bool> ();
for (int i = 0; s.get_next_char (ref i, out c);) {
stdout.printf (@"$i, $c\t");
if (records[c]){
result=true;stdout.printf("буква найдена: true\n");break;
}else{
records[c]=true;stdout.printf("буква не найдена: false\n");
}
}
}
/*Вывод
1, a буква не найдена: false
2, s буква не найдена: false
3, d буква не найдена: false
4, s буква найдена: true
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment