These pointers
char *s1, *s2;
with the automatic storage duration are not initialized and have indeterminate values. As a result the program has undefined behavior.
Use instead character arrays or objects of the type std::string.
Take into account that the function gets is not supported by the C Standard. Use fgets instead of gets.
Or as this is a C++ program then use std::getline or the member function std::cin.getline.
Pay attention to that this statement
cin >> s2;
does not allow to enter several words separated by white-spaces.
Here is a demonstrative program.
#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
int main() 
{
    const size_t N = 100;
    char s1[N];
    std::string s2;
    std::ios_base::sync_with_stdio();
    std::printf( "Enter your name and surname for fgets(): " );
    std::fgets( s1, sizeof( s1 ), stdin );
    s1[std::strcspn( s1, "\n" )] = '\0';
    std::printf( "Enter your name and surname for std::cin: " );
    std::getline( std::cin, s2 );
    std::cout << s1 << "! Hello from fgets" << std::endl;
    std::cout << s2 << "! Hello from std::cin" << std::endl;
    return 0;
}
Its output might look like
Enter your name and surname for fgets(): Bob Fisher
Enter your name and surname for std::cin: Tomas Man
Bob Fisher! Hello from fgets
Tomas Man! Hello from std::cin