参考 https://www.nowcoder.com/profile/702971721/codeBookDetail?submissionId=101883769

代码

#include <stdio.h>

int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        int i,j,k;
        for(i=0;i<=20;i++)
        {
            for(j=0;j<=(100-5*i)/3;j++)
            {
                k=3*(100-5*i-3*j);
                if((i+j+k)==100)
                    printf("%d %d %d\n",i,j,k);
            }
        }
    }
    return 0;
    
}