Start: Jun, 05, 2019 17:00:00
2019春ACM通识课考试(第三场)
End: Jun, 05, 2019 20:15:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 408ms
Memory: 44676kB
Author: 2018212212029
In contest: 1272

#include<stdio.h>
#include<string.h>
#include<map>
#include<iostream>
#include<vector>
using namespace std;
char str[10];
int sum[100];
char str2[55][100000][8];
int main(){
	int ans;
	for(int i=0;i<=9;i++){
		for(int j=0;j<=9;j++){
			for(int k=0;k<=9;k++){
				for(int l=0;l<=9;l++){
					for(int m=0;m<=9;m++){
						for(int n=0;n<=9;n++){
							ans=i+j+k+l+m+n;
							for(int b=0;b<=6;b++){
								if(b==6) str[b]='\0';
								else{
									if(b==0) str[b]=i+'0';
									else if(b==1) str[b]=j+'0';
									else if(b==2) str[b]=k+'0';
									else if(b==3) str[b]=l+'0';
									else if(b==4) str[b]=m+'0';
									else str[b]=n+'0';
								}
							}
							strcpy(str2[ans][++sum[ans]],str);
						}
					}
				}
			}
		}
	}
	for(int i=0;i<=54;i++){
		for(int j=1;j<=sum[i];j++){
			printf("%s\n",str2[i][j]);
		}
	}
}