Created
February 9, 2019 13:30
-
-
Save gavr123456789/9b8d585cba47a4afe2e0f7e485e0e0e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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