[SWEA] D1.몫과 나머지 출력하기 (C++)

jhyunn·2024년 3월 2일
0

SWEA

목록 보기
12/12

2029. 몫과 나머지 출력하기

문제 링크

#include <iostream>
 
using namespace std;
 
int main() {
    int T;
    cin >> T;
    for (int t = 1; t <= T; t++) {
        int a, b;
        cin >> a >> b;
        cout << "#" << t << " " << a/b << " " << a%b << endl;
    }
}

 
풀이

profile
https://github.com/Sungjeonghyun

0개의 댓글