User 高翌哲

Member for: 3 years (since Feb 25, 2021)
Type: Registered user
Student for 2020-2 C Programming
Full name:
Location:
Website:
About:

Activity by 高翌哲

Score: -2 points (ranked #3,229)
Questions: 0
Answers: 51
Comments: 0
Voted on: 0 questions, 0 answers
Gave out: 0 up votes, 0 down votes
Received: 0 up votes, 0 down votes

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