C++经典编程题目(华为笔试题一)买钉子问题

两种钉子包装,一种一盒9个,一种一盒4个,现有n个钉子,最少买几盒? #include <stdio.h> #include <iostream> using namespace std; #define N1 4 #define N2 9 int main() { int n; cin >> n; int max = n / N1 + 1; if (n % N1 == 0) {
相关文章
相关标签/搜索