/10809_알파벳 찾기 (21.11.20 성공).cpp Secret
Created
August 9, 2022 11:48
This file contains 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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int alp[26]; | |
char c; | |
int i = -1; | |
for (int k = 0; k < 26; k++) | |
{ | |
alp[k] = -1; | |
} | |
do | |
{ | |
cin.get(c); | |
i++; | |
if (alp[c - 97] != -1) | |
continue; | |
alp[c - 97] = i; | |
} while (c != '\n'); | |
for (i = 0; i < 26; i++) | |
{ | |
cout << alp[i] << " "; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment