본문 바로가기
PROGRAMMING CODE/C

[BAEKJOON] No.2908 C언어

by daye_ 2021. 10. 18.

상수

#include <stdio.h>

int changeNum(int num){ 
    int n=100,tmp=0;
    for(int i=0; i<3; i++){
        tmp += (num%10)*n;
        n/=10;
        num/=10;
    }
    return tmp;
};

void max(int num1,int num2){
    if(num1>num2) printf("%d\n",num1);
    else printf("%d\n",num2);
};

int main(){
    int num1,num2;
    scanf("%d %d",&num1,&num2);
    num1 = changeNum(num1);
    num2 = changeNum(num2);
    max(num1,num2);
    return 0;
}

'PROGRAMMING CODE > C' 카테고리의 다른 글

[BAEKJOON] No.2941 C언어  (0) 2021.10.19
[BAEKJOON] No.5622 C언어  (0) 2021.10.18
[BAEKJOON] No.1152 C언어  (0) 2021.10.18
[BAEKJOON] No.1157 C언어  (0) 2021.10.18
[BAEKJOON] No.2675 C언어  (0) 2021.10.18