Untitled
unknown
plain_text
3 years ago
393 B
4
Indexable
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a;
b = a;
c = 0;
while (b > 1){
if (b >= 5) {
c += b / 5 ;
b -= b/5*5;
}
else if (b >= 4) {
c += b / 4;
b -= b/4*4;
}
else if (b >= 3) {
c += b / 3;
b -= b/3*3;
}
else if (b >= 2) {
c += b / 2;
b -= b/2*2;
}
}
if (b == 1) c += 1;
cout << c;
}Editor is loading...