Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include<stdio.h>
- #include <iostream>
- #include <string>
- using namespace std;
- const int N = 80;
- int main()
- {
- //string s="";
- //string s1 = "";
- //string s2 = "";
- // String res ="";
- //Console.WriteLine(s);
- char s[N];
- //getline(cin, s);
- fgets(s, sizeof(s), stdin);
- char a='3';
- // cin.get >>a;
- //scanf("%d", &a);
- // Console.WriteLine(a);
- char b = ' ';
- int t = 0;
- int j = 0;
- for (int i = 0; i < N; i++)
- {
- j = j + 1;
- if (s[i] == '\0')
- {
- break;
- }
- }
- char *res = new char[j];
- char *res1 = new char[j];
- /*for (int i = 0; i<j; i++)
- {
- res[i] = s[i];
- }
- */
- for (int i = 0; i<j; i++)
- {
- if (s[i] == a)
- {
- t = i;
- }
- // Console.Write(res[i]);
- }
- for (int i = 0; i<t; i++)
- {
- res[i] = s[i];
- cout << res[i];
- }
- cout << endl;
- for (int i = t + 1; i<j; i++)
- {
- res1[i] = s[i];
- cout << res1[i];
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement