Advertisement
bom6er

Lab4.1

Oct 12th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <conio.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <locale.h>
  6. #include <iostream>
  7. #include <string>
  8. using namespace std;
  9.  
  10. void main()
  11.  
  12. {
  13.     setlocale(LC_ALL, "RUS");
  14.     char s[100]; int n, k;
  15.     n = 0;
  16.     gets_s(s);
  17.     k = strlen(s);
  18.     for (int i = 0; i < k; i++)
  19.     {
  20.         if (s[i] == ' ' || s[i] == ',' || s[i] == ';')
  21.         {
  22.             cout << endl;
  23.         }
  24.         else
  25.         {
  26.             cout << s[i];
  27.         }
  28.     }
  29.     _getch();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement