1 solutions
-
0
C :
int main(int argc, const char * argv[]) { char data[100]; char str1[100]; char str2[100]; int length = 0; int position = 4; gets(data); scanf("%d",&position); memcpy(str1,data,sizeof(char)*position); strcpy(str2, &data[position]); printf("%s\n",str1); printf("%s\n",str2); }C++ :
#include<bits/stdc++.h> using namespace std; string a; int t; int main() { getline(cin,a); cin>>t; for(int i=0;i<t;i++) cout<<a[i]; cout<<endl; for(int i=t;i<a.size();i++) cout<<a[i]; return 0; }
- 1
Information
- ID
- 18091
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By