大佬球助!!!
查看原帖
大佬球助!!!
1381478
wangyutong1208楼主2024/8/17 17:03

为什么80分啊!!!

代码奉上:

# include <bits/stdc++.h>
using namespace std;

int s[10]={6,2,5,5,4,5,6,3,7,6},shu;

int shendu(int a){
	int b;
	shu = 0;
	for (int i=1;;i++){
		b = a%10;
		a /= 10;
		if (a==0){
			if (b==0) shu += 6;
			else shu += s[b];
			return shu;
		}
		if (b==0) shu += 6;
	  else shu += s[b];
	}
}

int main (){
	int n,da=0,sh1,sh2,sh3;
	cin >> n;
	for (int i=0;i<711;i++){
		for (int j=0;j<711;j++){
			sh1 = shendu(i);
			sh2 = shendu(j);
			sh3 = shendu(i+j);
			if (sh1+sh2+sh3+4==n) da++;
		}
	}
	cout << da;
	return 0;
}

球球啦!!!

2024/8/17 17:03
加载中...