Advertisement
MykytaAtP1

string laborotary project

Nov 19th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<stdio.h>
  4. using namespace std;
  5. int main()
  6. {
  7.     int i = 5;
  8.     char* str= new char[i];
  9.     bool flag;
  10.     cout << "Enter elements of your string:" << endl;
  11.     do
  12.     {
  13.     cin >> str[i];
  14.     if (str[i] = 1, 2, 3, 4, 5, 6, 7, 8, 9, 0)
  15.     {
  16.         flag = true;
  17.     }
  18.     }
  19.     while (flag==false);
  20.     int j = strlen(str);
  21.     cout << "Lenght of your string :" << j << endl;
  22.     delete[] str;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement