Wall for 高翌哲

#include<stdio.h>
int main(){
    int m , n ;
    scanf("%d%d" ,&m ,&n) ;
    int a[m] , b[n] , c[16] ;
    for(int i = 0 ; i < m ; i ++){
        scanf("%d" ,&a[i]) ;
        }
    for(int j = 0 ; j < n ; j ++){
        scanf("%d" ,&b[j]) ;
        }
    
    if(m > n){
        for(int j = 0 ; j < n ; j ++){
            int pass ;
            for(int i = 0 ; i < m ; i ++)    
                if (a[i] == b[j]){
                    pass = a[i] ;
                       i = m ;
                    printf("%d " , pass) ;
                    }          
        }
    }else{
        for(int i = 0 ; i < m ; i ++){
            int pass ;
            for(int j = 0 ; j < n ; j ++)    
                if (a[i] == b[j]){
                    pass = b[j] ;
                    j = n ;
                    printf("%d " , pass) ;
                }      
        }    
    }
}
May 6, 2021 by 李世勛
12,783 questions
183,443 answers
172,219 comments
4,824 users