Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- char a[105],x[250];
- int main()
- {
- int i,c=0,t=3;
- cin.getline(a,105);
- for(i=0;i<strlen(a);i++)
- {
- if((a[i]>='a' && a[i]<='z') && a[i+1]==' ')
- {
- c=i;
- break;
- }
- }
- for(i=0;i<strlen(a);i++)
- {
- if((a[i+1]>='a' && a[i+1]<='z') && a[i]==' ')
- {
- x[0]=a[i+1];
- break;
- }
- }
- x[1]='.';
- x[2]=' ';
- for(i=0;i<=c;i++)
- {
- x[t]=a[i];
- t++;
- // cout<<a[i]<<" ";
- }
- cout<<x;
- return 0;
- }
Add Comment
Please, Sign In to add comment