Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #define JUM 20
- int main()
- {
- char input[JUM];
- int jumlahAngka=0;
- int i =0;
- bool same =false;
- scanf("%d", &jumlahAngka);
- while(i < jumlahAngka)
- {
- input[i] = _getch();
- if(i>0)
- for(int j=0; j < i; j++)
- {
- if(input[i] == input[j]){
- same = true; break;}
- }
- input[i+1] = '\0';
- printf("\r%s",input);
- i++;
- }
- if(same)
- puts("\nNo");
- else
- puts("\nYes");
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement