View Code of Problem 4054

#include<stdio.h>
#include<math.h>
#include<string.h>
int max(int a,int b){
	return a>b?a:b;
}
int main(){
	int n;
	long long a[6]={0};
	scanf("%d",&n);
	long long sum;
	while(n--){
		scanf("%lld",&sum);
		a[0]=sum/100;
		sum%=100;
		a[1]=sum/50;
		sum%=50;
		a[2]=sum/20;
		sum%=20;
		a[3]=sum/10;
		sum%=10;
		a[4]=sum/5;
		sum%=5;
		a[5]=sum/1;
		printf("%lld %lld %lld %lld %lld %lld\n",a[0],a[1],a[2],a[3],a[4],a[5]);
	}
}

Double click to view unformatted code.


Back to problem 4054