题解 | #KiKi和酸奶#
KiKi和酸奶
http://www.nowcoder.com/practice/c7721f3a1b1a47a783974453e82cadbb
- 多组读取语法:
temp = scanf("%d %d %d", &n, &h, &m)
- 余数大于0,加1
#include <stdio.h>
int main() {
int n, h, m, temp;
while ((temp = scanf("%d %d %d", &n, &h, &m)) != EOF) {
// temp = scanf("%d %d %d", &n, &h, &m);
if ((m % h) > 0) {
printf("%d\n", n - (m / h + 1));
} else {
printf("%d\n", n - (m / h));
}
}
return 0;
}