6 solutions

  • 1
    @ 2026-11-1 11:20:59

    简便版

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    
    	string s1,s2,s3,t;
        cin>>s1>>s2>>s3>>t;
    
        for(int i=0;i<t.size();i++){
            if(t[i]=='1') cout<<s1;
            if(t[i]=='2') cout<<s2;
            if(t[i]=='3') cout<<s3;
        }
        
    	return 0;
    }
    
    
    • 1
      @ 2025-12-31 20:13:23
      #include<bits/stdc++.h>
      using namespace std;
      string t[5];
      string s1;
      int main()
      {
      	string n;
      	for(int i=1;i<=3;i++)
      	{
      		cin>>t[i];
      	}
      	cin>>n;
      	int m=n.size();
      	for(int j=0;j<m;j++)
      	{
      		if(n[j]=='1')
      		{
      			cout<<t[1];
      		}
      		else if(n[j]=='2')
      		{
      			cout<<t[2];
      		}
      		else if(n[j]=='3')
      		{
      			cout<<t[3];
      		}
      	}
          return 0;
      }
      • 0
        @ 2026-8-20 10:22:22
        #include<bits/stdc++.h>
        using namespace std;
        string t[5];
        string s1;
        int main()
        {
        	string n;
        	for(int i=1;i<=3;i++)
        	{
        		cin>>t[i];
        	}
        	cin>>n;
        	int m=n.size();
        	for(int j=0;j<m;j++)
        	{
        		if(n[j]=='1')
        		{
        			cout<<t[1];
        		}
        		else if(n[j]=='2')
        		{
        			cout<<t[2];
        		}
        		else if(n[j]=='3')
        		{
        			cout<<t[3];
        		}
        	}
            return 0;
        }
        
        • 0
          @ 2026-8-20 10:21:52
          #include<bits/stdc++.h>
          using namespace std;
          string t[5];
          string s1;
          int main()
          {
          	string n;
          	for(int i=1;i<=3;i++)
          	{
          		cin>>t[i];
          	}
          	cin>>n;
          	int m=n.size();
          	for(int j=0;j<m;j++)
          	{
          		if(n[j]=='1')
          		{
          			cout<<t[1];
          		}
          		else if(n[j]=='2')
          		{
          			cout<<t[2];
          		}
          		else if(n[j]=='3')
          		{
          			cout<<t[3];
          		}
          	}
              return 0;
          }
          
          • 0
            @ 2026-4-1 11:48:47

            #include <bits/stdc++.h> using namespace std; string t[5]; string s1; int main() { string n; for(int i=1;i<=3;i++) { cin>>t[i]; }

            cin>>n;
            int m=n.size();
            for(int j=0;j<m;j++)
            {
            	if(n[j]=='1')
            	{
            		cout<<t[1];
            	}
            	else if(n[j]=='2')
            	{
            		cout<<t[2];
            	}
            	else if(n[j]=='3')
            	{
            		cout<<t[3];
            	}
            }
            return 0;
            

            }

            • -1
              @ 2025-8-19 16:21:19
              #include<bits/stdc++.h>
              using namespace std;
              string t[5];
              string s1; 
              int main(){
              	string T;
              	for(int i=1;i<=3;i++){
              		cin>>t[i];
              	}
              	cin>>T;
              	int n=T.size();
              	for(int k=0;k<n;k++){
              		if(T[k]=='1'){
              			cout<<t[1];
              		}else if(T[k]=='2'){
              			cout<<t[2];
              		}else if(T[k]=='3'){
              			cout<<t[3];
              		}
              	}
              	return 0;
              }
              
            • 1

            Information

            ID
            2394
            Time
            1000ms
            Memory
            256MiB
            Difficulty
            1
            Tags
            (None)
            # Submissions
            54
            Accepted
            34
            Uploaded By