Created
December 23, 2016 14:13
-
-
Save IgorVodka/27ddea92dffb8110c1a37caf4a3496cf 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
| // ConsoleApplication4.cpp: определяет точку входа для консольного приложения. | |
| // | |
| #include "stdafx.h" | |
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| char* buf = new char[81]; | |
| cin.getline(buf, 80); | |
| bool used[256] = { 0 }; | |
| while (*buf != '\0') { | |
| if (*buf >= 'a' && *buf <= 'z') { | |
| if (!used[*buf]) { | |
| cout << *buf; | |
| used[*buf] = true; | |
| } | |
| } | |
| else if (*buf == ' ' && (*(buf - 1) != ' ')) { | |
| cout << ' '; | |
| memset(used, 0, 256 * sizeof used[0]); | |
| } | |
| buf++; | |
| } | |
| system("pause > nul"); | |
| return 0; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment