Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- using namespace std;
- void printWords(char str[]) {
- char word[128];
- for (unsigned int i = 0, ind=0; i <= strlen(str); i++) {
- word[ind] = str[i];
- if (str[i] == ' ' || str[i] == '\0') {
- word[ind] = NULL;
- cout << word << "\n";
- ind = 0;
- }
- else ind++;
- }
- }
- void sort(char str[], int n) {
- }
- int main() {
- char s[128];
- int words = 0;
- scanf("%256[^\n]%*c", s);
- printWords(s);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement