Transparent White Star

[백준/C] 10430번: 나머지

     

    문제가 갑자기 심플해졌어요

    ...그냥 나머지라니

     

    #include <stdio.h>
    int main(){
        int a, b, c;
        scanf("%d %d %d", &a, &b, &c);
        printf("%d\n", (a+b)%c);
        printf("%d\n", ((a%c)+(b%c))%c);
        printf("%d\n", (a*b)%c);
        printf("%d", (a%c)*(b%c)%c);
        
        return 0;
    }

    괄호 닫다가 눈 빠질 뻔했습니다.

    다들 괄호를 조심하세요.

    댓글