#include <iostream> using namespace std; int main() { // 500,100,50,20,10,5,2,1 int n; int count1,count2,count3,count4,count5,count6,count7,count8; count1=count2=count3=count4=count5=count6=count7=count8=0; cin>>n; if(n>=500){ count1=n/500; n=n%500; } if(n>=100){ count2=n/100; n=n%100; } if(n>=50){ count3=n/50; ...