样例过了,评测没过,求调
查看原帖
样例过了,评测没过,求调
1378709
Yue_Hao楼主2025/2/7 20:50
#include <stdio.h>
inline int read(){
	int x = 0, f = 1;
	char ch;
	ch = getchar();
	while(ch < '0' || ch > '9'){
		if(ch == '-') f = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9'){
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	return (x * f);
}
namespace io{
	inline bool value(int x){
		int sum = 0;
		while(x != 0){
			sum += (x % 10);
			x /= 10;
		}
		if(sum == 7) return true;
		else return false;
	}
}
using namespace io;
signed main(){
	int n, x;
	scanf("%d", &n);
	while(n--){
		x = read();
		if(value(x)) puts("Yes\n");
		else puts("No\n");
	}
	return 0;
}
2025/2/7 20:50
加载中...