티스토리 뷰
https://www.acmicpc.net/problem/10833
[ 문제 풀이 ]
사과를 사람 수로 나눈 나머지를 다 더하면 된다.
[ 코드 ]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <stdio.h> int main( void ) { int n; int student, apple, remain = 0; scanf ( "%d" , &n); for ( int i = 0; i < n; i++) { scanf ( "%d %d" , &student, &apple); remain += (apple % student); } printf ( "%d\n" , remain); return 0; } |
'알고리즘 > 기초구현' 카테고리의 다른 글
백준_방번호 (0) | 2016.09.08 |
---|---|
codeground 개구리 뛰기 (0) | 2016.08.25 |
codeground 프로그래밍 경진대회 (0) | 2016.08.24 |
codeground 미궁속의 방 (1) | 2016.08.24 |
KOI초등 벨트 (0) | 2016.07.19 |