Submission

Status:

[P-SSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: asdasd

Problemset: สตริงซ้ำซ้ำ

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-10 22:47:14

#include <stdio.h>
#include <string.h>
int main(){
    char word1[30];
    char word2[30];
    scanf("%s" ,word1);
    scanf("%s" ,word2);
    int count_1 = strlen(word1);
    int count_2 = strlen(word2);
    int max = count_1;
    int min = count_2;

    for(int i = 0 ; i<min ; i++){
        for(int j = 0 ; j<max ; j++)
            if(word1[j]==word2[i]){
                printf("%c ",word1[j]);
        }
    }
}